From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: linux-gpio@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/8] gpiolib: remove asm-generic/gpio.h
Date: Thu, 26 Jan 2023 15:46:23 +0200 [thread overview]
Message-ID: <Y9KELwugMhV1TCiK@smile.fi.intel.com> (raw)
In-Reply-To: <20230126132801.2042371-4-arnd@kernel.org>
On Thu, Jan 26, 2023 at 02:27:56PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The asm-generic/gpio.h file is now always included when
> using gpiolib, so just move its contents into linux/gpio.h
> with a few minor simplifications.
Thanks! Very appreciated, my comments below.
...
> --- a/drivers/gpio/gpio-davinci.c
> +++ b/drivers/gpio/gpio-davinci.c
> @@ -7,6 +7,7 @@
> */
> #include <linux/gpio/driver.h>
> +#include <linux/gpio.h>
I believe the driver does not need this.
I have briefly checked all gpio_ places in it and found nothing that requires
this inclusion to be done.
> #include <linux/errno.h>
> #include <linux/kernel.h>
> #include <linux/clk.h>
> @@ -24,8 +25,6 @@
> #include <linux/spinlock.h>
> #include <linux/pm_runtime.h>
>
> -#include <asm-generic/gpio.h>
> -
> #define MAX_REGS_BANKS 5
> #define MAX_INT_PER_BANK 32
Thanks for this, that was a PITA!
...
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -30,7 +30,7 @@
>
> #ifdef CONFIG_GPIOLIB
> #include "../gpio/gpiolib.h"
> -#include <asm-generic/gpio.h>
> +#include <linux/gpio.h>
Can we actually swap them?
#include <linux/gpio.h>
#include "../gpio/gpiolib.h"
But hold on, why do we even need gpio.h here?!
> #endif
>
> #include "core.h"
...
> --- a/include/linux/gpio.h
> +++ b/include/linux/gpio.h
> @@ -54,26 +54,101 @@ struct gpio {
> };
>
> #ifdef CONFIG_GPIOLIB
> -#include <asm-generic/gpio.h>
> +#include <linux/compiler.h>
> +#include <linux/gpio/driver.h>
> +#include <linux/gpio/consumer.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
...
> +/*
> + * "valid" GPIO numbers are nonnegative and may be passed to
> + * setup routines like gpio_request(). only some valid numbers
While at it, '. only' --> '. Only'.
> + * can successfully be requested and used.
> + *
> + * Invalid GPIO numbers are useful for indicating no-such-GPIO in
> + * platform data and other tables.
> + */
...
> +extern int gpio_request(unsigned gpio, const char *label);
> +extern void gpio_free(unsigned gpio);
While at it, s/extern//.
...
> +extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
> +extern int gpio_request_array(const struct gpio *array, size_t num);
> +extern void gpio_free_array(const struct gpio *array, size_t num);
Ditto.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-01-26 13:46 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 13:27 [PATCH 0/8] gpiolib cleanups Arnd Bergmann
2023-01-26 13:27 ` [PATCH 1/8] gpiolib: remove empty asm/gpio.h files Arnd Bergmann
2023-01-27 9:41 ` Bartosz Golaszewski
2023-01-27 13:04 ` Linus Walleij
2023-01-26 13:27 ` [PATCH 2/8] gpiolib: coldfire: remove custom asm/gpio.h Arnd Bergmann
2023-01-27 9:41 ` Bartosz Golaszewski
2023-01-27 13:05 ` Linus Walleij
2023-01-26 13:27 ` [PATCH 3/8] gpiolib: remove asm-generic/gpio.h Arnd Bergmann
2023-01-26 13:46 ` Andy Shevchenko [this message]
2023-01-26 15:43 ` Arnd Bergmann
2023-01-27 13:07 ` Linus Walleij
2023-01-27 13:14 ` Arnd Bergmann
2023-01-26 13:27 ` [PATCH 4/8] gpiolib: remove gpio_set_debounce Arnd Bergmann
2023-01-26 13:50 ` Andy Shevchenko
2023-01-26 15:30 ` Arnd Bergmann
2023-01-27 13:09 ` Linus Walleij
2023-01-26 13:27 ` [PATCH 5/8] gpiolib: remove legacy gpio_export Arnd Bergmann
2023-01-26 14:00 ` Andy Shevchenko
2023-01-26 16:02 ` Arnd Bergmann
2023-01-27 13:09 ` Linus Walleij
2023-01-26 13:27 ` [PATCH 6/8] gpiolib: split linux/gpio/driver.h out of linux/gpio.h Arnd Bergmann
2023-01-26 14:04 ` Andy Shevchenko
2023-01-26 14:51 ` Arnd Bergmann
2023-01-27 13:15 ` Linus Walleij
2023-01-26 13:28 ` [PATCH 7/8] gpiolib: split of_mm_gpio_chip out of linux/of_gpio.h Arnd Bergmann
2023-01-26 14:08 ` Andy Shevchenko
2023-01-26 14:54 ` Arnd Bergmann
2023-01-27 13:17 ` Linus Walleij
2023-01-26 13:28 ` [PATCH 8/8] gpiolib: move of_gpio_flags into gpiolib-of.c Arnd Bergmann
2023-01-26 14:09 ` Andy Shevchenko
2023-01-26 14:47 ` Arnd Bergmann
2023-01-27 8:53 ` Andy Shevchenko
2023-01-27 9:43 ` Bartosz Golaszewski
2023-01-27 9:46 ` Arnd Bergmann
2023-01-27 9:48 ` Andy Shevchenko
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=Y9KELwugMhV1TCiK@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=christophe.leroy@csgroup.eu \
--cc=dmitry.torokhov@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@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
Powered by JetHome