linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] i2c: Provide a stub for i2c_detect_slave_mode()
@ 2017-07-06 17:26 Andy Shevchenko
  2017-07-08 19:55 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2017-07-06 17:26 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c, Luis.Oliveira, linux-next, Jarkko Nikula
  Cc: Andy Shevchenko

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: 6e38cf3b4421 ("i2c: designware: Let slave adapter support be optional")
Reported-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/i2c.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 72d0ece70ed3..00ca5b86a753 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -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
 
 /**
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] i2c: Provide a stub for i2c_detect_slave_mode()
  2017-07-06 17:26 [PATCH v1] i2c: Provide a stub for i2c_detect_slave_mode() Andy Shevchenko
@ 2017-07-08 19:55 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2017-07-08 19:55 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-i2c, Luis.Oliveira, linux-next, Jarkko Nikula

[-- Attachment #1: Type: text/plain, Size: 915 bytes --]

On Thu, Jul 06, 2017 at 08:26:17PM +0300, Andy Shevchenko wrote:
> 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: 6e38cf3b4421 ("i2c: designware: Let slave adapter support be optional")
> Reported-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

I'll apply it and push out. Buildbot found this issue as well and should
give me a success report...

Thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-08 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-06 17:26 [PATCH v1] i2c: Provide a stub for i2c_detect_slave_mode() Andy Shevchenko
2017-07-08 19:55 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).