Message ID | 20231120144641.1660574-20-andriy.shevchenko@linux.intel.com |
---|---|
State | Superseded |
Headers | show |
Series | i2c: designware: code consolidation & cleanups | expand |
Hi Andy, On Mon, Nov 20, 2023 at 04:42:01PM +0200, Andy Shevchenko wrote: > Since i2c_dw_probe() is going to be extended, uninline it to reduce > the noise in the common header. where is it going to be extended? It's not in thie series. I'm fine with the patch anyway as it cleans up the header file. Thanks, Andi
Hi Andy, On Thu, Nov 30, 2023 at 03:28:18PM +0200, Andy Shevchenko wrote: > On Thu, Nov 30, 2023 at 12:21:51AM +0100, Andi Shyti wrote: > > Hi Andy, > > > > On Mon, Nov 20, 2023 at 04:42:01PM +0200, Andy Shevchenko wrote: > > > Since i2c_dw_probe() is going to be extended, uninline it to reduce > > > the noise in the common header. > > > > where is it going to be extended? It's not in thie series. I'm > > fine with the patch anyway as it cleans up the header file. > > It's used to be in the previous versions of the series where I have > device_set_node() API to be used. Thanks! I think this missed: Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Andi
diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c index 7c877e380605..1d213bc0bbfa 100644 --- a/drivers/i2c/busses/i2c-designware-common.c +++ b/drivers/i2c/busses/i2c-designware-common.c @@ -714,6 +714,20 @@ void i2c_dw_disable(struct dw_i2c_dev *dev) } EXPORT_SYMBOL_GPL(i2c_dw_disable); +int i2c_dw_probe(struct dw_i2c_dev *dev) +{ + switch (dev->mode) { + case DW_IC_SLAVE: + return i2c_dw_probe_slave(dev); + case DW_IC_MASTER: + return i2c_dw_probe_master(dev); + default: + dev_err(dev->dev, "Wrong operation mode: %d\n", dev->mode); + return -EINVAL; + } +} +EXPORT_SYMBOL_GPL(i2c_dw_probe); + static int i2c_dw_prepare(struct device *device) { /* diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h index f6ebf86dcc6f..7479cb3a450d 100644 --- a/drivers/i2c/busses/i2c-designware-core.h +++ b/drivers/i2c/busses/i2c-designware-core.h @@ -10,9 +10,7 @@ */ #include <linux/bits.h> -#include <linux/compiler_types.h> #include <linux/completion.h> -#include <linux/dev_printk.h> #include <linux/errno.h> #include <linux/i2c.h> #include <linux/pm.h> @@ -367,19 +365,6 @@ static inline void i2c_dw_configure_slave(struct dw_i2c_dev *dev) { } static inline int i2c_dw_probe_slave(struct dw_i2c_dev *dev) { return -EINVAL; } #endif -static inline int i2c_dw_probe(struct dw_i2c_dev *dev) -{ - switch (dev->mode) { - case DW_IC_SLAVE: - return i2c_dw_probe_slave(dev); - case DW_IC_MASTER: - return i2c_dw_probe_master(dev); - default: - dev_err(dev->dev, "Wrong operation mode: %d\n", dev->mode); - return -EINVAL; - } -} - static inline void i2c_dw_configure(struct dw_i2c_dev *dev) { if (i2c_detect_slave_mode(dev->dev)) @@ -388,6 +373,8 @@ static inline void i2c_dw_configure(struct dw_i2c_dev *dev) i2c_dw_configure_master(dev); } +int i2c_dw_probe(struct dw_i2c_dev *dev); + #if IS_ENABLED(CONFIG_I2C_DESIGNWARE_BAYTRAIL) int i2c_dw_baytrail_probe_lock_support(struct dw_i2c_dev *dev); #endif
Since i2c_dw_probe() is going to be extended, uninline it to reduce the noise in the common header. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/i2c/busses/i2c-designware-common.c | 14 ++++++++++++++ drivers/i2c/busses/i2c-designware-core.h | 17 ++--------------- 2 files changed, 16 insertions(+), 15 deletions(-)