From: kernel test robot <lkp@intel.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: oe-kbuild-all@lists.linux.dev, linux-hwmon@vger.kernel.org
Subject: [groeck-staging:hwmon-staging 70/86] include/linux/i2c_spi.h:34:23: error: implicit declaration of function 'i2c_add_driver'
Date: Mon, 18 Nov 2024 11:29:01 +0800 [thread overview]
Message-ID: <202411181128.dvbT1ThQ-lkp@intel.com> (raw)
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
reply other threads:[~2024-11-18 3:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202411181128.dvbT1ThQ-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=oe-kbuild-all@lists.linux.dev \
/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.