[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a24wkBEAnWG8=LYoVR1oiTo0VKZ3iME+FYbDuHXJDjMOw@mail.gmail.com>
Date: Tue, 9 Nov 2021 11:50:17 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 6/8] gpiolib: remove legacy gpio_export
On Tue, Nov 9, 2021 at 11:30 AM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Tue, Nov 09, 2021 at 11:02:05AM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@...db.de>
> >
> > There are only a handful of users of gpio_export() and
> > related functions.
> >
> > As these are just wrappers around the modern gpiod_export()
> > helper, remove the wrappers and open-code the gpio_to_desc
> > in all callers to shrink the legacy API.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
>
> What I wish to see meanwhile is a section in the TODO list somewhere to clean
> up those modules that have gpio.h. Linus, do we have one in the kernel or is
> it your personal TODO?
>
> In case we have one in the kernel, please add there modules you modified in
> a way that they still need further attention.
I think the TODO list is in Linus' head, but it would include all the files
that use one of the interfaces in linux/gpio.h. I found about 350 of them,
so there is little point in listing them one at a time. IIRC Linus is going
through those one subsystem at a time.
It might help to make it harder to get new users if we add some pattern
matching to scripts/checkpatch.pl, and/or something for scripts/coccinelle/.
I don't think it's possible to convert a gpio_request() user to gpio_get()
in a scripted way because you usually have to change the platform side
at the same time as the driver side.
I also found that we have a ton of users of linux/of_gpio.h, which is
somewhere inbetween the linux/gpio.h interface and the
linux/gpio/consumer.h version.
> > @@ -259,17 +259,19 @@ static int evm_sw_setup(struct i2c_client *client, int gpio,
> > char label[10];
> >
> > for (i = 0; i < 4; ++i) {
> > + struct gpio_desc *desc = gpio_to_desc(gpio + i);
> > +
> > snprintf(label, 10, "user_sw%d", i);
> > - status = gpio_request(gpio, label);
> > + status = gpio_request(gpio + i, label);
>
> Shouldn't be gpiod_get() or so at the end?
Yes, but that would be a more invasive change that I think should be done
separately.
Arnd
Powered by blists - more mailing lists