Skip to content

Commit 9f9decd

Browse files
arndbjic23
authored andcommitted
iio: accel: fxls8962af: fix i2c dependency
With CONFIG_SPI=y and CONFIG_I2C=m, building fxls8962af into vmlinux causes a link error against the I2C module: aarch64-linux-ld: drivers/iio/accel/fxls8962af-core.o: in function `fxls8962af_fifo_flush': fxls8962af-core.c:(.text+0x3a0): undefined reference to `i2c_verify_client' Work around it by adding a Kconfig dependency that forces the SPI driver to be a loadable module whenever I2C is a module. Fixes: af959b7 ("iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 7e77ef8 commit 9f9decd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/iio/accel/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ config DMARD10
231231

232232
config FXLS8962AF
233233
tristate
234+
depends on I2C || !I2C # cannot be built-in for modular I2C
234235

235236
config FXLS8962AF_I2C
236237
tristate "NXP FXLS8962AF/FXLS8964AF Accelerometer I2C Driver"
@@ -247,6 +248,7 @@ config FXLS8962AF_I2C
247248
config FXLS8962AF_SPI
248249
tristate "NXP FXLS8962AF/FXLS8964AF Accelerometer SPI Driver"
249250
depends on SPI
251+
depends on I2C || !I2C
250252
select FXLS8962AF
251253
select REGMAP_SPI
252254
help

0 commit comments

Comments
 (0)