Skip to content

Commit 588e5a0

Browse files
andy-shevAndi Shyti
authored andcommitted
i2c: designware: Uninline i2c_dw_probe()
Since i2c_dw_probe() is going to be extended, uninline it to reduce the noise in the common header. Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent 18024d6 commit 588e5a0

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

drivers/i2c/busses/i2c-designware-common.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,20 @@ void i2c_dw_disable(struct dw_i2c_dev *dev)
737737
}
738738
EXPORT_SYMBOL_GPL(i2c_dw_disable);
739739

740+
int i2c_dw_probe(struct dw_i2c_dev *dev)
741+
{
742+
switch (dev->mode) {
743+
case DW_IC_SLAVE:
744+
return i2c_dw_probe_slave(dev);
745+
case DW_IC_MASTER:
746+
return i2c_dw_probe_master(dev);
747+
default:
748+
dev_err(dev->dev, "Wrong operation mode: %d\n", dev->mode);
749+
return -EINVAL;
750+
}
751+
}
752+
EXPORT_SYMBOL_GPL(i2c_dw_probe);
753+
740754
static int i2c_dw_prepare(struct device *device)
741755
{
742756
/*

drivers/i2c/busses/i2c-designware-core.h

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
*/
1111

1212
#include <linux/bits.h>
13-
#include <linux/compiler_types.h>
1413
#include <linux/completion.h>
15-
#include <linux/dev_printk.h>
1614
#include <linux/errno.h>
1715
#include <linux/i2c.h>
1816
#include <linux/pm.h>
@@ -388,19 +386,6 @@ static inline void i2c_dw_configure_slave(struct dw_i2c_dev *dev) { }
388386
static inline int i2c_dw_probe_slave(struct dw_i2c_dev *dev) { return -EINVAL; }
389387
#endif
390388

391-
static inline int i2c_dw_probe(struct dw_i2c_dev *dev)
392-
{
393-
switch (dev->mode) {
394-
case DW_IC_SLAVE:
395-
return i2c_dw_probe_slave(dev);
396-
case DW_IC_MASTER:
397-
return i2c_dw_probe_master(dev);
398-
default:
399-
dev_err(dev->dev, "Wrong operation mode: %d\n", dev->mode);
400-
return -EINVAL;
401-
}
402-
}
403-
404389
static inline void i2c_dw_configure(struct dw_i2c_dev *dev)
405390
{
406391
if (i2c_detect_slave_mode(dev->dev))
@@ -409,6 +394,8 @@ static inline void i2c_dw_configure(struct dw_i2c_dev *dev)
409394
i2c_dw_configure_master(dev);
410395
}
411396

397+
int i2c_dw_probe(struct dw_i2c_dev *dev);
398+
412399
#if IS_ENABLED(CONFIG_I2C_DESIGNWARE_BAYTRAIL)
413400
int i2c_dw_baytrail_probe_lock_support(struct dw_i2c_dev *dev);
414401
#endif

0 commit comments

Comments
 (0)