Skip to content

Commit

Permalink
i2c: Provide a stub for i2c_detect_slave_mode()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
andy-shev authored and Wolfram Sang committed Jul 8, 2017
1 parent 6e38cf3 commit 8f1a357
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ static inline int i2c_slave_event(struct i2c_client *client,
{
return client->slave_cb(client, event, val);
}
#else
static inline bool i2c_detect_slave_mode(struct device *dev) { return false; }
#endif

/**
Expand Down

0 comments on commit 8f1a357

Please sign in to comment.