Skip to content

Commit 8f1a357

Browse files
andy-shevWolfram Sang
authored andcommitted
i2c: Provide a stub for i2c_detect_slave_mode()
Drivers would like to call i2c_detect_slave_mode() even if !I2C_SLAVE. Give them what they want to, Otherwise kernel will not compile: drivers/i2c/busses/i2c-designware-platdrv.c: In function ‘dw_i2c_plat_probe’: drivers/i2c/busses/i2c-designware-platdrv.c:331:6: error: implicit declaration of function ‘i2c_detect_slave_mode’ [-Werror=implicit-function-declaration] if (i2c_detect_slave_mode(&pdev->dev)) ^~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors Fixes: 6e38cf3 ("i2c: designware: Let slave adapter support be optional") Reported-by: Abdul Haleem <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 6e38cf3 commit 8f1a357

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/linux/i2c.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ static inline int i2c_slave_event(struct i2c_client *client,
295295
{
296296
return client->slave_cb(client, event, val);
297297
}
298+
#else
299+
static inline bool i2c_detect_slave_mode(struct device *dev) { return false; }
298300
#endif
299301

300302
/**

0 commit comments

Comments
 (0)