[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210721151330.2176653-1-arnd@kernel.org>
Date: Wed, 21 Jul 2021 17:13:20 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: Jonathan Cameron <jic23@...nel.org>,
Sean Nyekjaer <sean@...nix.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Lars-Peter Clausen <lars@...afoo.de>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Stephan Gerhold <stephan@...hold.net>,
Hans de Goede <hdegoede@...hat.com>,
Tomas Melin <tomas.melin@...sala.com>,
Mike Looijmans <mike.looijmans@...ic.nl>,
Alexandru Ardelean <aardelean@...iqon.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] iio: accel: fxls8962af: fix i2c dependency
From: Arnd Bergmann <arnd@...db.de>
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: af959b7b96b8 ("iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
I'm not overly happy with the fix either, but couldn't think of
a better idea. If someone provide a different fix, please ignore
mine.
---
drivers/iio/accel/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig
index 0e56ace61103..8d8b1ba42ff8 100644
--- a/drivers/iio/accel/Kconfig
+++ b/drivers/iio/accel/Kconfig
@@ -231,6 +231,7 @@ config DMARD10
config FXLS8962AF
tristate
+ depends on I2C || !I2C # cannot be built-in for modular I2C
config FXLS8962AF_I2C
tristate "NXP FXLS8962AF/FXLS8964AF Accelerometer I2C Driver"
@@ -247,6 +248,7 @@ config FXLS8962AF_I2C
config FXLS8962AF_SPI
tristate "NXP FXLS8962AF/FXLS8964AF Accelerometer SPI Driver"
depends on SPI
+ depends on I2C || !I2C
select FXLS8962AF
select REGMAP_SPI
help
--
2.29.2
Powered by blists - more mailing lists