Re: [PATCH] gpio: drop unnecessary includes from include/linux/gpio/driver.h

From: Masahiro Yamada
Date: Tue Jul 04 2017 - 11:43:41 EST


2017-07-04 21:58 GMT+09:00 William Breathitt Gray <vilhelm.gray@xxxxxxxxx>:
> On Tue, Jul 04, 2017 at 12:53:34PM +0900, Masahiro Yamada wrote:
>>Some of include directives in include/linux/gpio/driver.h are
>>unneeded because the header does not need to know the content of
>>struct device, irq_chip, etc. Just declare they are structures.
>>
>>On the other hand, <linux/irqhandler.h> and <linux/spinlock_types.h>
>>turned out to be necessary for irq_flow_handler_t and spinlock_t,
>>respectively.
>>
>>Each driver should include what it needs without relying on what is
>>implicitly included from <linux/gpio/driver.h>. This will cut down
>>unnecessary header parsing.
>>
>>Signed-off-by: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
>>---
>>
>> drivers/gpio/gpio-104-dio-48e.c | 1 +
>> drivers/gpio/gpio-104-idi-48.c | 1 +
>> drivers/gpio/gpio-104-idio-16.c | 1 +
>> drivers/gpio/gpio-pci-idio-16.c | 2 ++
>> drivers/gpio/gpio-ws16c48.c | 1 +
>
> The changes to the above drivers look fine to me:
>
> Acked-by: William Breathitt Gray <vilhelm.gray@xxxxxxxxx>
>
> However, this patch as a whole does too many things; I'd like to see it
> split-up logically similar to how Andy Shevchenko suggested in his
> reply. That should allow ACKs by respective driver maintainers to be
> accounted more properly.
>
> William Breathitt Gray


I was missing a very important thing.

<linux/gpio/driver.h> is used in various subsystems.

I tested only under drivers/gpio/, but
drivers/pinctrl/ is one of the biggest source of compile errors.

(Probably I will get reports from kbuild test robot.)


So, I need to think about how to merge this (if the basic idea of this is OK).

Maybe,

[1] Send patches to subsystems (gpio, pinctrl, etc.) for v4.14
[2] Drop unneeded includes from linux/gpio/driver.h for v4.15


--
Best Regards
Masahiro Yamada