i2c: Include GPIO consumer header in main include

Linus Walleij linus.walleij at linaro.org
Tue Jan 16 01:47:29 PST 2018


On Mon, Jan 15, 2018 at 7:03 PM, Wolfram Sang <wsa at 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 at 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



More information about the linux-arm-kernel mailing list