* [groeck-staging:hwmon-staging 70/86] include/linux/i2c_spi.h:34:23: error: implicit declaration of function 'i2c_add_driver'
@ 2024-11-18 3:29 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-11-18 3:29 UTC (permalink / raw)
To: Guenter Roeck; +Cc: oe-kbuild-all, linux-hwmon
tree: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-staging
head: 777e5239066dfc6a3e170ec937370aa35faffdb3
commit: 11f8d85dc8f0dd5d13fedcd58af9f014cd3e77db [70/86] Revert "i2c: Dummy functions for i2c_register_driver and i2c_del_driver"
config: i386-randconfig-013-20241118 (https://download.01.org/0day-ci/archive/20241118/202411181128.dvbT1ThQ-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241118/202411181128.dvbT1ThQ-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411181128.dvbT1ThQ-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/hwmon/ltc2947.c:14:
include/linux/i2c_spi.h: In function 'i2c_spi_driver_register':
>> include/linux/i2c_spi.h:34:23: error: implicit declaration of function 'i2c_add_driver' [-Werror=implicit-function-declaration]
34 | ret = i2c_add_driver(i2cdrv);
| ^~~~~~~~~~~~~~
>> include/linux/i2c_spi.h:40:17: error: implicit declaration of function 'i2c_del_driver' [-Werror=implicit-function-declaration]
40 | i2c_del_driver(i2cdrv);
| ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/i2c_add_driver +34 include/linux/i2c_spi.h
e29c31c78716c5 Guenter Roeck 2024-11-14 14
e29c31c78716c5 Guenter Roeck 2024-11-14 15 /**
e29c31c78716c5 Guenter Roeck 2024-11-14 16 * i2c_spi_driver_register() - Register an I2C and a SPI driver
e29c31c78716c5 Guenter Roeck 2024-11-14 17 * @i2cdrv: the I2C driver to register
e29c31c78716c5 Guenter Roeck 2024-11-14 18 * @spidrv: the SPI driver to register
e29c31c78716c5 Guenter Roeck 2024-11-14 19 *
e29c31c78716c5 Guenter Roeck 2024-11-14 20 * This function registers both @i2cdev and @spidev, and fails if one of these
e29c31c78716c5 Guenter Roeck 2024-11-14 21 * registrations fails. This is mainly useful for devices that support both I2C
e29c31c78716c5 Guenter Roeck 2024-11-14 22 * and SPI modes.
e29c31c78716c5 Guenter Roeck 2024-11-14 23 * Note that the function only registers drivers for the enabled protocol(s).
e29c31c78716c5 Guenter Roeck 2024-11-14 24 * If neither I2C nor SPI are enabled, it does nothing.
e29c31c78716c5 Guenter Roeck 2024-11-14 25 *
e29c31c78716c5 Guenter Roeck 2024-11-14 26 * Return: 0 if enabled registrations succeeded, a negative error code otherwise.
e29c31c78716c5 Guenter Roeck 2024-11-14 27 */
e29c31c78716c5 Guenter Roeck 2024-11-14 28 static inline int i2c_spi_driver_register(struct i2c_driver *i2cdrv,
e29c31c78716c5 Guenter Roeck 2024-11-14 29 struct spi_driver *spidrv)
e29c31c78716c5 Guenter Roeck 2024-11-14 30 {
e29c31c78716c5 Guenter Roeck 2024-11-14 31 int ret = 0;
e29c31c78716c5 Guenter Roeck 2024-11-14 32
e29c31c78716c5 Guenter Roeck 2024-11-14 33 if (IS_ENABLED(CONFIG_I2C))
e29c31c78716c5 Guenter Roeck 2024-11-14 @34 ret = i2c_add_driver(i2cdrv);
e29c31c78716c5 Guenter Roeck 2024-11-14 35 if (ret || !IS_ENABLED(CONFIG_SPI))
e29c31c78716c5 Guenter Roeck 2024-11-14 36 return ret;
e29c31c78716c5 Guenter Roeck 2024-11-14 37
e29c31c78716c5 Guenter Roeck 2024-11-14 38 ret = spi_register_driver(spidrv);
e29c31c78716c5 Guenter Roeck 2024-11-14 39 if (ret && IS_ENABLED(CONFIG_I2C))
e29c31c78716c5 Guenter Roeck 2024-11-14 @40 i2c_del_driver(i2cdrv);
e29c31c78716c5 Guenter Roeck 2024-11-14 41
e29c31c78716c5 Guenter Roeck 2024-11-14 42 return ret;
e29c31c78716c5 Guenter Roeck 2024-11-14 43 }
e29c31c78716c5 Guenter Roeck 2024-11-14 44
:::::: The code at line 34 was first introduced by commit
:::::: e29c31c78716c57e9779ad846255ff0012e058fa Add infrastructure for supporting both I2C and SPI in single driver
:::::: TO: Guenter Roeck <linux@roeck-us.net>
:::::: CC: Guenter Roeck <linux@roeck-us.net>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-18 3:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18 3:29 [groeck-staging:hwmon-staging 70/86] include/linux/i2c_spi.h:34:23: error: implicit declaration of function 'i2c_add_driver' kernel test robot
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.