aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2021-06-03 17:58:35 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-06-07 09:19:21 +0100
commitaa5c8b25392800bbefa82dd19eeff8ebbf261ace (patch)
treee988b1bc171de707a462c26516ffa582d8d81dd4 /include/linux/i2c.h
parentLinux 5.13-rc1 (diff)
downloadwireguard-linux-aa5c8b25392800bbefa82dd19eeff8ebbf261ace.tar.xz
wireguard-linux-aa5c8b25392800bbefa82dd19eeff8ebbf261ace.zip
i2c: core: Add stub for i2c_verify_client() if !CONFIG_I2C
If I2C is not compiled, there is no way we should see a call to i2c_verify_client() on a device that is an i2c client. As such, provide a stub to return NULL to resolve an associated build failure. The build is failing with this link error ld: fxls8962af-core.o: in function `fxls8962af_fifo_transfer': fxls8962af-core.c: undefined reference to `i2c_verify_client' Reported-by: Tom Rix <trix@redhat.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Fixes: af959b7b96b8 ("iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads") Reviewed-by: Sean Nyekjaer <sean@geanix.com> Acked-by: Wolfram Sang <wsa@kernel.org> Link: https://lore.kernel.org/r/20210603165835.3594557-1-jic23@kernel.org
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index e8f2ac8c9c3d..7d71131c394e 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -343,7 +343,6 @@ struct i2c_client {
};
#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
-struct i2c_client *i2c_verify_client(struct device *dev);
struct i2c_adapter *i2c_verify_adapter(struct device *dev);
const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id,
const struct i2c_client *client);
@@ -477,6 +476,13 @@ i2c_new_ancillary_device(struct i2c_client *client,
u16 default_addr);
void i2c_unregister_device(struct i2c_client *client);
+
+struct i2c_client *i2c_verify_client(struct device *dev);
+#else
+static inline struct i2c_client *i2c_verify_client(struct device *dev)
+{
+ return NULL;
+}
#endif /* I2C */
/* Mainboard arch_initcall() code should register all its I2C devices.