Re: [PATCH v2] gpio: Avoid kernel.h inclusion where it's possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 05, 2020 at 03:43:36PM +0200, Andy Shevchenko wrote:
> Inclusion of kernel.h increases the mess with the header dependencies.
> Avoid kernel.h inclusion where it's possible.
> 
> Besides that, clean up a bit other inclusions inside GPIO subsystem headers.
> It includes:
>  - removal pin control bits (forward declaration and header) from linux/gpio.h
>  - removal of.h from asm-generic/gpio.h
>  - use of explicit headers in gpio/consumer.h
>  - add FIXME note with regard to gpio.h inclusion in of_gpio,h
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
> v2: Elaborate changes in the commit message (Bartosz)
>  include/asm-generic/gpio.h    | 4 ++--
>  include/linux/gpio.h          | 2 --
>  include/linux/gpio/consumer.h | 5 ++++-
>  include/linux/of_gpio.h       | 9 ++++++---
>  4 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
> index 19eadac415c4..aea9aee1f3e9 100644
> --- a/include/asm-generic/gpio.h
> +++ b/include/asm-generic/gpio.h
> @@ -2,10 +2,8 @@
>  #ifndef _ASM_GENERIC_GPIO_H
>  #define _ASM_GENERIC_GPIO_H
>  
> -#include <linux/kernel.h>
>  #include <linux/types.h>
>  #include <linux/errno.h>
> -#include <linux/of.h>
>  
>  #ifdef CONFIG_GPIOLIB
>  
> @@ -140,6 +138,8 @@ static inline void gpio_unexport(unsigned gpio)
>  
>  #else	/* !CONFIG_GPIOLIB */
>  
> +#include <linux/kernel.h>
> +

I don't really think moving the includes inside #ifdef's is an 
improvment.

But I'll leave it to Linus.

Rob



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux