aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2015-01-26 14:59:31 -0500
committerWolfram Sang <wsa@the-dreams.de>2015-01-26 16:05:20 -0500
commitd5fd120e7860c2b3d4c936a2ebadb6b244bec4c8 (patch)
treeaccfd5191f854f2bef8b6405ffb3cb07d4e801f0 /drivers/i2c
parent34e81ad5f0b60007c95995eb7803da7e00c6c611 (diff)
i2c: Only include slave support if selected
Make the slave support depend on CONFIG_I2C_SLAVE. Otherwise it gets included unconditionally, even when it is not needed. I2C bus drivers which implement slave support must select I2C_SLAVE. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/Kconfig1
-rw-r--r--drivers/i2c/i2c-core.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 31e8308ba899..ab838d9e28b6 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -881,6 +881,7 @@ config I2C_XLR
881config I2C_RCAR 881config I2C_RCAR
882 tristate "Renesas R-Car I2C Controller" 882 tristate "Renesas R-Car I2C Controller"
883 depends on ARCH_SHMOBILE || COMPILE_TEST 883 depends on ARCH_SHMOBILE || COMPILE_TEST
884 select I2C_SLAVE
884 help 885 help
885 If you say yes to this option, support will be included for the 886 If you say yes to this option, support will be included for the
886 R-Car I2C controller. 887 R-Car I2C controller.
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 39d25a8cb1ad..e9eae57a2b50 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -2972,6 +2972,7 @@ trace:
2972} 2972}
2973EXPORT_SYMBOL(i2c_smbus_xfer); 2973EXPORT_SYMBOL(i2c_smbus_xfer);
2974 2974
2975#if IS_ENABLED(CONFIG_I2C_SLAVE)
2975int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb) 2976int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb)
2976{ 2977{
2977 int ret; 2978 int ret;
@@ -3019,6 +3020,7 @@ int i2c_slave_unregister(struct i2c_client *client)
3019 return ret; 3020 return ret;
3020} 3021}
3021EXPORT_SYMBOL_GPL(i2c_slave_unregister); 3022EXPORT_SYMBOL_GPL(i2c_slave_unregister);
3023#endif
3022 3024
3023MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>"); 3025MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
3024MODULE_DESCRIPTION("I2C-Bus main module"); 3026MODULE_DESCRIPTION("I2C-Bus main module");