* [PATCH] i2c: Include GPIO consumer header in main include
@ 2017-12-08 13:39 ` Linus Walleij
0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2017-12-08 13:39 UTC (permalink / raw)
To: Wolfram Sang, linux-i2c; +Cc: linux-arm-kernel, Linus Walleij
It seems most users of <linux/i2c.h> pick up their
dependency of <linux/gpio/consumer.h> from other paths but
that is not a universal law, so include the header
explicitly so we have struct gpio_desc available.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
include/linux/i2c.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 5d7f3c1853ae..8b968c44ddfa 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -34,6 +34,7 @@
#include <linux/irqdomain.h> /* for Host Notify IRQ */
#include <linux/of.h> /* for struct device_node */
#include <linux/swab.h> /* for swab16 */
+#include <linux/gpio/consumer.h>
#include <uapi/linux/i2c.h>
extern struct bus_type i2c_bus_type;
--
2.14.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] i2c: Include GPIO consumer header in main include
@ 2017-12-08 13:39 ` Linus Walleij
0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2017-12-08 13:39 UTC (permalink / raw)
To: linux-arm-kernel
It seems most users of <linux/i2c.h> pick up their
dependency of <linux/gpio/consumer.h> from other paths but
that is not a universal law, so include the header
explicitly so we have struct gpio_desc available.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
include/linux/i2c.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 5d7f3c1853ae..8b968c44ddfa 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -34,6 +34,7 @@
#include <linux/irqdomain.h> /* for Host Notify IRQ */
#include <linux/of.h> /* for struct device_node */
#include <linux/swab.h> /* for swab16 */
+#include <linux/gpio/consumer.h>
#include <uapi/linux/i2c.h>
extern struct bus_type i2c_bus_type;
--
2.14.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: Include GPIO consumer header in main include
2017-12-08 13:39 ` Linus Walleij
@ 2017-12-12 22:33 ` Wolfram Sang
-1 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2017-12-12 22:33 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-i2c, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 481 bytes --]
On Fri, Dec 08, 2017 at 02:39:34PM +0100, Linus Walleij wrote:
> It seems most users of <linux/i2c.h> pick up their
> dependency of <linux/gpio/consumer.h> from other paths but
> that is not a universal law, so include the header
> explicitly so we have struct gpio_desc available.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Not sure. Having GPIOs is not really a requirement for I2C. I tend to
think drivers using it should include this explicitly?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] i2c: Include GPIO consumer header in main include
@ 2017-12-12 22:33 ` Wolfram Sang
0 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2017-12-12 22:33 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 08, 2017 at 02:39:34PM +0100, Linus Walleij wrote:
> It seems most users of <linux/i2c.h> pick up their
> dependency of <linux/gpio/consumer.h> from other paths but
> that is not a universal law, so include the header
> explicitly so we have struct gpio_desc available.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Not sure. Having GPIOs is not really a requirement for I2C. I tend to
think drivers using it should include this explicitly?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171212/de103bf0/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: i2c: Include GPIO consumer header in main include
2017-12-08 13:39 ` Linus Walleij
@ 2018-01-15 18:03 ` Wolfram Sang
-1 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2018-01-15 18:03 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-i2c, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 463 bytes --]
On Fri, Dec 08, 2017 at 02:39:34PM +0100, Linus Walleij wrote:
> It seems most users of <linux/i2c.h> pick up their
> dependency of <linux/gpio/consumer.h> from other paths but
> that is not a universal law, so include the header
> explicitly so we have struct gpio_desc available.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
I still think drivers needing GPIO should include it explicitly.
So, NAK until further arguments arrive...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* i2c: Include GPIO consumer header in main include
@ 2018-01-15 18:03 ` Wolfram Sang
0 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2018-01-15 18:03 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Dec 08, 2017 at 02:39:34PM +0100, Linus Walleij wrote:
> It seems most users of <linux/i2c.h> pick up their
> dependency of <linux/gpio/consumer.h> from other paths but
> that is not a universal law, so include the header
> explicitly so we have struct gpio_desc available.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
I still think drivers needing GPIO should include it explicitly.
So, NAK until further arguments arrive...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180115/11fd1e6e/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: i2c: Include GPIO consumer header in main include
2018-01-15 18:03 ` Wolfram Sang
(?)
@ 2018-01-16 9:47 ` Linus Walleij
-1 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2018-01-16 9:47 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, Linux ARM
On Mon, Jan 15, 2018 at 7:03 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> On Fri, Dec 08, 2017 at 02:39:34PM +0100, Linus Walleij wrote:
>> It seems most users of <linux/i2c.h> pick up their
>> dependency of <linux/gpio/consumer.h> from other paths but
>> that is not a universal law, so include the header
>> explicitly so we have struct gpio_desc available.
>>
>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>
> I still think drivers needing GPIO should include it explicitly.
> So, NAK until further arguments arrive...
What I mean is that they must be doing that currently since this
file uses struct gpio_desc (for recovert), else the build would fail.
So that is why I think it should be made explicit.
Another option is to just forward-declare struct gpio_desc;
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-01-16 9:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 13:39 [PATCH] i2c: Include GPIO consumer header in main include Linus Walleij
2017-12-08 13:39 ` Linus Walleij
2017-12-12 22:33 ` Wolfram Sang
2017-12-12 22:33 ` Wolfram Sang
2018-01-15 18:03 ` Wolfram Sang
2018-01-15 18:03 ` Wolfram Sang
2018-01-16 9:47 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.