summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-viai2c-common.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2024-05-28 14:06:30 +0200
committerAndi Shyti <andi.shyti@kernel.org>2024-06-26 16:07:21 +0200
commit103458874baca0bbc8ae0b66d50201d5faa8c17b (patch)
tree76c3d998cb63a9be2568f62fc7d4a88142f8f4b9 /drivers/i2c/busses/i2c-viai2c-common.h
parentf2661062f16b2de5d7b6a5c42a9a5c96326b8454 (diff)
i2c: viai2c: turn common code into a proper module
The i2c-viai2c-common.c file is used by two drivers, but is not a proper abstraction and can get linked into both modules in the same configuration, which results in a warning: scripts/Makefile.build:236: drivers/i2c/busses/Makefile: i2c-viai2c-common.o is added to multiple modules: i2c-wmt i2c-zhaoxin The other problems with this include the incorrect use of a __weak function when both are built-in, and the fact that the "common" module is sprinked with 'if (i2c->plat == ...)' checks that have knowledge about the differences between the drivers using it. Avoid the link time warning by making the common driver a proper module with MODULE_LICENCE()/MODULE_AUTHOR() tags, and remove the __weak function by slightly rearranging the code. This adds a little more duplication between the two main drivers, but those versions get more readable in the process. Fixes: a06b80e83011 ("i2c: add zhaoxin i2c controller driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Hans Hu <HansHu-oc@zhaoxin.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-viai2c-common.h')
-rw-r--r--drivers/i2c/busses/i2c-viai2c-common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-viai2c-common.h b/drivers/i2c/busses/i2c-viai2c-common.h
index 81e827c54434..00f17733223c 100644
--- a/drivers/i2c/busses/i2c-viai2c-common.h
+++ b/drivers/i2c/busses/i2c-viai2c-common.h
@@ -80,6 +80,6 @@ struct viai2c {
int viai2c_wait_bus_not_busy(struct viai2c *i2c);
int viai2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num);
int viai2c_init(struct platform_device *pdev, struct viai2c **pi2c, int plat);
-int viai2c_fifo_irq_xfer(struct viai2c *i2c, bool irq);
+int viai2c_irq_xfer(struct viai2c *i2c);
#endif