devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org, Frank Rowand <frowand.list@gmail.com>,
	devicetree@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2] gpio: Avoid kernel.h inclusion where it's possible
Date: Thu, 6 Feb 2020 14:47:29 -0700	[thread overview]
Message-ID: <20200206214729.GA30344@bogus> (raw)
In-Reply-To: <20200205134336.20197-1-andriy.shevchenko@linux.intel.com>

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@linux.intel.com>
> ---
> 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

  reply	other threads:[~2020-02-06 21:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 13:43 [PATCH v2] gpio: Avoid kernel.h inclusion where it's possible Andy Shevchenko
2020-02-06 21:47 ` Rob Herring [this message]
2020-02-06 22:07   ` Andy Shevchenko
2020-02-10 11:59 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200206214729.GA30344@bogus \
    --to=robh@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=bgolaszewski@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).