From: kernel test robot <lkp@intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Oleksij Rempel" <linux@rempel-privat.de>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"NXP Linux Team" <linux-imx@nxp.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
linux-i2c@vger.kernel.org,
Pengutronix Kernel Team <kernel@pengutronix.de>,
linux-clk@vger.kernel.org
Subject: Re: [PATCH] i2c: imx: Simplify using devm_clk_get_prepared()
Date: Fri, 26 Mar 2021 21:42:22 +0800 [thread overview]
Message-ID: <202103262156.62p07Mp2-lkp@intel.com> (raw)
In-Reply-To: <20210324201223.75921-1-u.kleine-koenig@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 7005 bytes --]
Hi "Uwe,
I love your patch! Perhaps something to improve:
[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on clk/clk-next shawnguo/for-next v5.12-rc4 next-20210326]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Uwe-Kleine-K-nig/i2c-imx-Simplify-using-devm_clk_get_prepared/20210325-041454
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: arm64-randconfig-r033-20210326 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project f490a5969bd52c8a48586f134ff8f02ccbb295b3)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/2241b5e30667c72568ec9dc31ab14475bb04a408
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Uwe-Kleine-K-nig/i2c-imx-Simplify-using-devm_clk_get_prepared/20210325-041454
git checkout 2241b5e30667c72568ec9dc31ab14475bb04a408
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/i2c/busses/i2c-imx.c:1408:17: error: implicit declaration of function 'devm_clk_get_prepared' [-Werror,-Wimplicit-function-declaration]
i2c_imx->clk = devm_clk_get_prepared(&pdev->dev, NULL);
^
>> drivers/i2c/busses/i2c-imx.c:1408:15: warning: incompatible integer to pointer conversion assigning to 'struct clk *' from 'int' [-Wint-conversion]
i2c_imx->clk = devm_clk_get_prepared(&pdev->dev, NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
vim +1408 drivers/i2c/busses/i2c-imx.c
1363
1364 static int i2c_imx_probe(struct platform_device *pdev)
1365 {
1366 struct imx_i2c_struct *i2c_imx;
1367 struct resource *res;
1368 struct imxi2c_platform_data *pdata = dev_get_platdata(&pdev->dev);
1369 void __iomem *base;
1370 int irq, ret;
1371 dma_addr_t phy_addr;
1372 const struct imx_i2c_hwdata *match;
1373
1374 dev_dbg(&pdev->dev, "<%s>\n", __func__);
1375
1376 irq = platform_get_irq(pdev, 0);
1377 if (irq < 0)
1378 return irq;
1379
1380 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1381 base = devm_ioremap_resource(&pdev->dev, res);
1382 if (IS_ERR(base))
1383 return PTR_ERR(base);
1384
1385 phy_addr = (dma_addr_t)res->start;
1386 i2c_imx = devm_kzalloc(&pdev->dev, sizeof(*i2c_imx), GFP_KERNEL);
1387 if (!i2c_imx)
1388 return -ENOMEM;
1389
1390 match = device_get_match_data(&pdev->dev);
1391 if (match)
1392 i2c_imx->hwdata = match;
1393 else
1394 i2c_imx->hwdata = (struct imx_i2c_hwdata *)
1395 platform_get_device_id(pdev)->driver_data;
1396
1397 /* Setup i2c_imx driver structure */
1398 strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
1399 i2c_imx->adapter.owner = THIS_MODULE;
1400 i2c_imx->adapter.algo = &i2c_imx_algo;
1401 i2c_imx->adapter.dev.parent = &pdev->dev;
1402 i2c_imx->adapter.nr = pdev->id;
1403 i2c_imx->adapter.dev.of_node = pdev->dev.of_node;
1404 i2c_imx->base = base;
1405 ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev->dev));
1406
1407 /* Get I2C clock */
> 1408 i2c_imx->clk = devm_clk_get_prepared(&pdev->dev, NULL);
1409 if (IS_ERR(i2c_imx->clk))
1410 return dev_err_probe(&pdev->dev, PTR_ERR(i2c_imx->clk),
1411 "can't get prepared I2C clock\n");
1412
1413 /* Init queue */
1414 init_waitqueue_head(&i2c_imx->queue);
1415
1416 /* Set up adapter data */
1417 i2c_set_adapdata(&i2c_imx->adapter, i2c_imx);
1418
1419 /* Set up platform driver data */
1420 platform_set_drvdata(pdev, i2c_imx);
1421
1422 pm_runtime_set_autosuspend_delay(&pdev->dev, I2C_PM_TIMEOUT);
1423 pm_runtime_use_autosuspend(&pdev->dev);
1424 pm_runtime_set_active(&pdev->dev);
1425 pm_runtime_enable(&pdev->dev);
1426
1427 ret = pm_runtime_get_sync(&pdev->dev);
1428 if (ret < 0)
1429 goto rpm_disable;
1430
1431 /* Request IRQ */
1432 ret = request_threaded_irq(irq, i2c_imx_isr, NULL, IRQF_SHARED,
1433 pdev->name, i2c_imx);
1434 if (ret) {
1435 dev_err(&pdev->dev, "can't claim irq %d\n", irq);
1436 goto rpm_disable;
1437 }
1438
1439 /* Set up clock divider */
1440 i2c_imx->bitrate = I2C_MAX_STANDARD_MODE_FREQ;
1441 ret = of_property_read_u32(pdev->dev.of_node,
1442 "clock-frequency", &i2c_imx->bitrate);
1443 if (ret < 0 && pdata && pdata->bitrate)
1444 i2c_imx->bitrate = pdata->bitrate;
1445 i2c_imx->clk_change_nb.notifier_call = i2c_imx_clk_notifier_call;
1446 clk_notifier_register(i2c_imx->clk, &i2c_imx->clk_change_nb);
1447 i2c_imx_set_clk(i2c_imx, clk_get_rate(i2c_imx->clk));
1448
1449 i2c_imx_reset_regs(i2c_imx);
1450
1451 /* Init optional bus recovery function */
1452 ret = i2c_imx_init_recovery_info(i2c_imx, pdev);
1453 /* Give it another chance if pinctrl used is not ready yet */
1454 if (ret == -EPROBE_DEFER)
1455 goto clk_notifier_unregister;
1456
1457 /* Add I2C adapter */
1458 ret = i2c_add_numbered_adapter(&i2c_imx->adapter);
1459 if (ret < 0)
1460 goto clk_notifier_unregister;
1461
1462 pm_runtime_mark_last_busy(&pdev->dev);
1463 pm_runtime_put_autosuspend(&pdev->dev);
1464
1465 dev_dbg(&i2c_imx->adapter.dev, "claimed irq %d\n", irq);
1466 dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n", res);
1467 dev_dbg(&i2c_imx->adapter.dev, "adapter name: \"%s\"\n",
1468 i2c_imx->adapter.name);
1469 dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
1470
1471 /* Init DMA config if supported */
1472 i2c_imx_dma_request(i2c_imx, phy_addr);
1473
1474 return 0; /* Return OK */
1475
1476 clk_notifier_unregister:
1477 clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb);
1478 free_irq(irq, i2c_imx);
1479 rpm_disable:
1480 pm_runtime_put_noidle(&pdev->dev);
1481 pm_runtime_disable(&pdev->dev);
1482 pm_runtime_set_suspended(&pdev->dev);
1483 pm_runtime_dont_use_autosuspend(&pdev->dev);
1484 clk_disable_unprepare(i2c_imx->clk);
1485 return ret;
1486 }
1487
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] i2c: imx: Simplify using devm_clk_get_prepared()
Date: Fri, 26 Mar 2021 21:42:22 +0800 [thread overview]
Message-ID: <202103262156.62p07Mp2-lkp@intel.com> (raw)
In-Reply-To: <20210324201223.75921-1-u.kleine-koenig@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 7178 bytes --]
Hi "Uwe,
I love your patch! Perhaps something to improve:
[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on clk/clk-next shawnguo/for-next v5.12-rc4 next-20210326]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Uwe-Kleine-K-nig/i2c-imx-Simplify-using-devm_clk_get_prepared/20210325-041454
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: arm64-randconfig-r033-20210326 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project f490a5969bd52c8a48586f134ff8f02ccbb295b3)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/2241b5e30667c72568ec9dc31ab14475bb04a408
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Uwe-Kleine-K-nig/i2c-imx-Simplify-using-devm_clk_get_prepared/20210325-041454
git checkout 2241b5e30667c72568ec9dc31ab14475bb04a408
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/i2c/busses/i2c-imx.c:1408:17: error: implicit declaration of function 'devm_clk_get_prepared' [-Werror,-Wimplicit-function-declaration]
i2c_imx->clk = devm_clk_get_prepared(&pdev->dev, NULL);
^
>> drivers/i2c/busses/i2c-imx.c:1408:15: warning: incompatible integer to pointer conversion assigning to 'struct clk *' from 'int' [-Wint-conversion]
i2c_imx->clk = devm_clk_get_prepared(&pdev->dev, NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
vim +1408 drivers/i2c/busses/i2c-imx.c
1363
1364 static int i2c_imx_probe(struct platform_device *pdev)
1365 {
1366 struct imx_i2c_struct *i2c_imx;
1367 struct resource *res;
1368 struct imxi2c_platform_data *pdata = dev_get_platdata(&pdev->dev);
1369 void __iomem *base;
1370 int irq, ret;
1371 dma_addr_t phy_addr;
1372 const struct imx_i2c_hwdata *match;
1373
1374 dev_dbg(&pdev->dev, "<%s>\n", __func__);
1375
1376 irq = platform_get_irq(pdev, 0);
1377 if (irq < 0)
1378 return irq;
1379
1380 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1381 base = devm_ioremap_resource(&pdev->dev, res);
1382 if (IS_ERR(base))
1383 return PTR_ERR(base);
1384
1385 phy_addr = (dma_addr_t)res->start;
1386 i2c_imx = devm_kzalloc(&pdev->dev, sizeof(*i2c_imx), GFP_KERNEL);
1387 if (!i2c_imx)
1388 return -ENOMEM;
1389
1390 match = device_get_match_data(&pdev->dev);
1391 if (match)
1392 i2c_imx->hwdata = match;
1393 else
1394 i2c_imx->hwdata = (struct imx_i2c_hwdata *)
1395 platform_get_device_id(pdev)->driver_data;
1396
1397 /* Setup i2c_imx driver structure */
1398 strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
1399 i2c_imx->adapter.owner = THIS_MODULE;
1400 i2c_imx->adapter.algo = &i2c_imx_algo;
1401 i2c_imx->adapter.dev.parent = &pdev->dev;
1402 i2c_imx->adapter.nr = pdev->id;
1403 i2c_imx->adapter.dev.of_node = pdev->dev.of_node;
1404 i2c_imx->base = base;
1405 ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev->dev));
1406
1407 /* Get I2C clock */
> 1408 i2c_imx->clk = devm_clk_get_prepared(&pdev->dev, NULL);
1409 if (IS_ERR(i2c_imx->clk))
1410 return dev_err_probe(&pdev->dev, PTR_ERR(i2c_imx->clk),
1411 "can't get prepared I2C clock\n");
1412
1413 /* Init queue */
1414 init_waitqueue_head(&i2c_imx->queue);
1415
1416 /* Set up adapter data */
1417 i2c_set_adapdata(&i2c_imx->adapter, i2c_imx);
1418
1419 /* Set up platform driver data */
1420 platform_set_drvdata(pdev, i2c_imx);
1421
1422 pm_runtime_set_autosuspend_delay(&pdev->dev, I2C_PM_TIMEOUT);
1423 pm_runtime_use_autosuspend(&pdev->dev);
1424 pm_runtime_set_active(&pdev->dev);
1425 pm_runtime_enable(&pdev->dev);
1426
1427 ret = pm_runtime_get_sync(&pdev->dev);
1428 if (ret < 0)
1429 goto rpm_disable;
1430
1431 /* Request IRQ */
1432 ret = request_threaded_irq(irq, i2c_imx_isr, NULL, IRQF_SHARED,
1433 pdev->name, i2c_imx);
1434 if (ret) {
1435 dev_err(&pdev->dev, "can't claim irq %d\n", irq);
1436 goto rpm_disable;
1437 }
1438
1439 /* Set up clock divider */
1440 i2c_imx->bitrate = I2C_MAX_STANDARD_MODE_FREQ;
1441 ret = of_property_read_u32(pdev->dev.of_node,
1442 "clock-frequency", &i2c_imx->bitrate);
1443 if (ret < 0 && pdata && pdata->bitrate)
1444 i2c_imx->bitrate = pdata->bitrate;
1445 i2c_imx->clk_change_nb.notifier_call = i2c_imx_clk_notifier_call;
1446 clk_notifier_register(i2c_imx->clk, &i2c_imx->clk_change_nb);
1447 i2c_imx_set_clk(i2c_imx, clk_get_rate(i2c_imx->clk));
1448
1449 i2c_imx_reset_regs(i2c_imx);
1450
1451 /* Init optional bus recovery function */
1452 ret = i2c_imx_init_recovery_info(i2c_imx, pdev);
1453 /* Give it another chance if pinctrl used is not ready yet */
1454 if (ret == -EPROBE_DEFER)
1455 goto clk_notifier_unregister;
1456
1457 /* Add I2C adapter */
1458 ret = i2c_add_numbered_adapter(&i2c_imx->adapter);
1459 if (ret < 0)
1460 goto clk_notifier_unregister;
1461
1462 pm_runtime_mark_last_busy(&pdev->dev);
1463 pm_runtime_put_autosuspend(&pdev->dev);
1464
1465 dev_dbg(&i2c_imx->adapter.dev, "claimed irq %d\n", irq);
1466 dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n", res);
1467 dev_dbg(&i2c_imx->adapter.dev, "adapter name: \"%s\"\n",
1468 i2c_imx->adapter.name);
1469 dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
1470
1471 /* Init DMA config if supported */
1472 i2c_imx_dma_request(i2c_imx, phy_addr);
1473
1474 return 0; /* Return OK */
1475
1476 clk_notifier_unregister:
1477 clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb);
1478 free_irq(irq, i2c_imx);
1479 rpm_disable:
1480 pm_runtime_put_noidle(&pdev->dev);
1481 pm_runtime_disable(&pdev->dev);
1482 pm_runtime_set_suspended(&pdev->dev);
1483 pm_runtime_dont_use_autosuspend(&pdev->dev);
1484 clk_disable_unprepare(i2c_imx->clk);
1485 return ret;
1486 }
1487
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 41819 bytes --]
next prev parent reply other threads:[~2021-03-26 13:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 13:50 [PATCH v3 0/3] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König
2021-03-01 13:50 ` [PATCH v3 1/3] clk: generalize devm_clk_get() a bit Uwe Kleine-König
2021-03-01 13:50 ` [PATCH v3 2/3] clk: Provide new devm_clk_helpers for prepared and enabled clocks Uwe Kleine-König
2021-03-01 13:50 ` [PATCH v3 3/3] pwm: atmel: Simplify using devm_clk_get_prepared() Uwe Kleine-König
2021-03-22 14:22 ` [PATCH v3 0/3] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König
2021-03-24 20:12 ` [PATCH] i2c: imx: Simplify using devm_clk_get_prepared() Uwe Kleine-König
2021-03-24 20:22 ` Uwe Kleine-König
2021-03-25 4:49 ` Oleksij Rempel
2021-03-26 13:42 ` kernel test robot [this message]
2021-03-26 13:42 ` kernel test robot
2021-03-31 3:37 ` kernel test robot
2021-03-31 3:37 ` kernel test robot
2021-03-24 20:17 ` [PATCH] spi: davinci: " Uwe Kleine-König
2021-03-24 20:22 ` Uwe Kleine-König
2021-03-30 17:04 ` Mark Brown
2021-03-30 4:09 ` kernel test robot
2021-03-30 4:09 ` kernel test robot
2021-03-24 20:27 ` [PATCH] rtc: at91sma9: Simplify using devm_clk_get_enabled() Uwe Kleine-König
2021-03-24 20:27 ` Uwe Kleine-König
2021-03-25 1:11 ` kernel test robot
2021-03-25 1:11 ` kernel test robot
2021-03-25 1:11 ` kernel test robot
2021-03-25 15:15 ` kernel test robot
2021-03-25 15:15 ` kernel test robot
2021-03-25 15:15 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202103262156.62p07Mp2-lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=festevam@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=kernel@pengutronix.de \
--cc=linux-clk@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux@rempel-privat.de \
--cc=mturquette@baylibre.com \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.