Re: [PATCH] i2c: gpio: replace printk with dev_err in probe

From: kernel test robot

Date: Sat Mar 21 2026 - 18:24:23 EST


Hi Jovin,

kernel test robot noticed the following build errors:

[auto build test ERROR on andi-shyti/i2c/i2c-host]
[also build test ERROR on wsa/i2c/for-next linus/master v7.0-rc4 next-20260320]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Jovin-Basil/i2c-gpio-replace-printk-with-dev_err-in-probe/20260322-012109
base: https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git i2c/i2c-host
patch link: https://lore.kernel.org/r/20260320150144.432345-1-jovin555%40gmail.com
patch subject: [PATCH] i2c: gpio: replace printk with dev_err in probe
config: csky-randconfig-r073-20260322 (https://download.01.org/0day-ci/archive/20260322/202603220644.6OGhQIXH-lkp@xxxxxxxxx/config)
compiler: csky-linux-gcc (GCC) 15.2.0
smatch: v0.5.0-9004-gb810ac53
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260322/202603220644.6OGhQIXH-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603220644.6OGhQIXH-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from include/linux/device.h:15,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from include/linux/i2c-algo-bit.h:13,
from drivers/i2c/busses/i2c-gpio.c:11:
drivers/i2c/busses/i2c-gpio.c: In function 'i2c_gpio_init':
>> drivers/i2c/busses/i2c-gpio.c:493:26: error: 'pdev' undeclared (first use in this function); did you mean 'cdev'?
493 | dev_err(&pdev->dev, "i2c-gpio: probe failed: %d\n",ret);
| ^~~~
include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
drivers/i2c/busses/i2c-gpio.c:493:17: note: in expansion of macro 'dev_err'
493 | dev_err(&pdev->dev, "i2c-gpio: probe failed: %d\n",ret);
| ^~~~~~~
drivers/i2c/busses/i2c-gpio.c:493:26: note: each undeclared identifier is reported only once for each function it appears in
493 | dev_err(&pdev->dev, "i2c-gpio: probe failed: %d\n",ret);
| ^~~~
include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
drivers/i2c/busses/i2c-gpio.c:493:17: note: in expansion of macro 'dev_err'
493 | dev_err(&pdev->dev, "i2c-gpio: probe failed: %d\n",ret);
| ^~~~~~~


vim +493 drivers/i2c/busses/i2c-gpio.c

486
487 static int __init i2c_gpio_init(void)
488 {
489 int ret;
490
491 ret = platform_driver_register(&i2c_gpio_driver);
492 if (ret)
> 493 dev_err(&pdev->dev, "i2c-gpio: probe failed: %d\n",ret);
494
495 return ret;
496 }
497 subsys_initcall(i2c_gpio_init);
498

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki