All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 6/8] gpiolib: remove legacy gpio_export
Date: Tue, 9 Nov 2021 23:46:53 +0100	[thread overview]
Message-ID: <CAK8P3a0J1f9+o6Uqdn4QeQ=30oW6p+fOaFU7-5L0cW-zihfNxg@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdZaJQqwyosnXhaOc=mF5jJxaDKDKAQxJGJvQAWpU7MNQQ@mail.gmail.com>

On Tue, Nov 9, 2021 at 9:42 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Tue, Nov 9, 2021 at 11:50 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> > I think the TODO list is in Linus' head,
>
> Oh no, drivers/gpio/TODO
>
> > 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.
>
> Yeah but if it's just me I doubt that I will manage to do it by the
> time I retire in 2037 or so... So the TODO is there to inspire others
> to step in and help out.

I think at the current rate, it should only take about another ten years: ;-)

$ for i in v3.18 v4.1 v4.4 v4.9 v4.14 v4.19 v5.4 v5.10 v5.15 ; do echo
-n $i\  ;  git grep -wl
'\<\(gpio_direction_input\|gpio_direction_output\|gpio_get_value_cansleep\|gpio_set_value_cansleep\|gpio_get_value\|gpio_set_value\|gpio_to_irq\|gpio_request\|gpio_request_one\|gpio_request_array\)\>\|\<\(ARCH_NR_GPIOS\|GPIOF_DIR_\|GPIOF_INIT\|GPIOF_EXPORT\|GPIOF_OPEN\|GPIOF_IN\|GPIOF_OUT\|gpio_is_valid\\|gpio_free\|devm_gpio_\)'
$i | wc -l ; done
v3.18 676
v4.1 669
v4.4 646
v4.9 639
v4.14 614
v4.19 553
v5.4 465
v5.10 381
v5.15 354

I'm a fan of deconstruction interfaces one function call at a time, which
is different from your one-subsystem at a time approach, but these can
obviously be done at the same time. This 8-patch series is hopefully a good
step in that direction, removing some of the more obscure interfaces
and making the rest a little more obvious.

I've also started a patch series to remove some of the less common
of_gpio portions, which gets rid of of_get_gpio(), of_get_gpio_flags()
and of_get_named_gpio_flags() but leaves of_get_named_gpio() in
place for now. I'm much less confident about that work though, so I
haven't posted that. I think killing off the of_gpio consumer-side
interfaces entirely would likely make the biggest impact, as those
appear to still be used a lot in relatively modern drivers, while the
traditional gpio_request() interfaces are mainly used in drivers for
legacy boards that don't have a long future ahead of them unless
they get converted to DT.

        Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	 "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	 Linux ARM <linux-arm-kernel@lists.infradead.org>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 6/8] gpiolib: remove legacy gpio_export
Date: Tue, 9 Nov 2021 23:46:53 +0100	[thread overview]
Message-ID: <CAK8P3a0J1f9+o6Uqdn4QeQ=30oW6p+fOaFU7-5L0cW-zihfNxg@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdZaJQqwyosnXhaOc=mF5jJxaDKDKAQxJGJvQAWpU7MNQQ@mail.gmail.com>

On Tue, Nov 9, 2021 at 9:42 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Tue, Nov 9, 2021 at 11:50 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> > I think the TODO list is in Linus' head,
>
> Oh no, drivers/gpio/TODO
>
> > 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.
>
> Yeah but if it's just me I doubt that I will manage to do it by the
> time I retire in 2037 or so... So the TODO is there to inspire others
> to step in and help out.

I think at the current rate, it should only take about another ten years: ;-)

$ for i in v3.18 v4.1 v4.4 v4.9 v4.14 v4.19 v5.4 v5.10 v5.15 ; do echo
-n $i\  ;  git grep -wl
'\<\(gpio_direction_input\|gpio_direction_output\|gpio_get_value_cansleep\|gpio_set_value_cansleep\|gpio_get_value\|gpio_set_value\|gpio_to_irq\|gpio_request\|gpio_request_one\|gpio_request_array\)\>\|\<\(ARCH_NR_GPIOS\|GPIOF_DIR_\|GPIOF_INIT\|GPIOF_EXPORT\|GPIOF_OPEN\|GPIOF_IN\|GPIOF_OUT\|gpio_is_valid\\|gpio_free\|devm_gpio_\)'
$i | wc -l ; done
v3.18 676
v4.1 669
v4.4 646
v4.9 639
v4.14 614
v4.19 553
v5.4 465
v5.10 381
v5.15 354

I'm a fan of deconstruction interfaces one function call at a time, which
is different from your one-subsystem at a time approach, but these can
obviously be done at the same time. This 8-patch series is hopefully a good
step in that direction, removing some of the more obscure interfaces
and making the rest a little more obvious.

I've also started a patch series to remove some of the less common
of_gpio portions, which gets rid of of_get_gpio(), of_get_gpio_flags()
and of_get_named_gpio_flags() but leaves of_get_named_gpio() in
place for now. I'm much less confident about that work though, so I
haven't posted that. I think killing off the of_gpio consumer-side
interfaces entirely would likely make the biggest impact, as those
appear to still be used a lot in relatively modern drivers, while the
traditional gpio_request() interfaces are mainly used in drivers for
legacy boards that don't have a long future ahead of them unless
they get converted to DT.

        Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-11-09 22:48 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 10:01 [PATCH v2 0/8] gpiolib header cleanup Arnd Bergmann
2021-11-09 10:01 ` Arnd Bergmann
2021-11-09 10:02 ` [PATCH v2 1/8] gpiolib: remove irq_to_gpio() definition Arnd Bergmann
2021-11-09 10:02   ` Arnd Bergmann
2021-11-09 10:02 ` [PATCH v2 2/8] gpiolib: remove empty asm/gpio.h files Arnd Bergmann
2021-11-09 10:02   ` Arnd Bergmann
2021-11-09 10:02 ` [PATCH v2 3/8] gpiolib: coldfire: remove custom asm/gpio.h Arnd Bergmann
2021-11-09 10:02   ` Arnd Bergmann
2021-11-09 10:02 ` [PATCH v2 4/8] gpiolib: remove asm-generic/gpio.h Arnd Bergmann
2021-11-09 10:02   ` Arnd Bergmann
2021-11-09 10:19   ` Andy Shevchenko
2021-11-09 10:19     ` Andy Shevchenko
2021-11-09 10:02 ` [PATCH v2 5/8] gpiolib: shrink further Arnd Bergmann
2021-11-09 10:02   ` Arnd Bergmann
2021-11-09 10:24   ` Andy Shevchenko
2021-11-09 10:24     ` Andy Shevchenko
2021-11-09 11:18     ` Arnd Bergmann
2021-11-09 11:18       ` Arnd Bergmann
2021-11-09 22:17       ` Linus Walleij
2021-11-09 22:17         ` Linus Walleij
2021-11-10 12:39         ` Arnd Bergmann
2021-11-10 12:39           ` Arnd Bergmann
2021-11-09 10:02 ` [PATCH v2 6/8] gpiolib: remove legacy gpio_export Arnd Bergmann
2021-11-09 10:02   ` Arnd Bergmann
2021-11-09 10:30   ` Andy Shevchenko
2021-11-09 10:30     ` Andy Shevchenko
2021-11-09 10:50     ` Arnd Bergmann
2021-11-09 10:50       ` Arnd Bergmann
2021-11-09 20:42       ` Linus Walleij
2021-11-09 20:42         ` Linus Walleij
2021-11-09 22:46         ` Arnd Bergmann [this message]
2021-11-09 22:46           ` Arnd Bergmann
2021-11-10  0:03           ` Linus Walleij
2021-11-10  0:03             ` Linus Walleij
2021-11-09 20:33     ` Linus Walleij
2021-11-09 20:33       ` Linus Walleij
2021-11-09 10:02 ` [PATCH v2 7/8] gpiolib: remove gpio_to_chip Arnd Bergmann
2021-11-09 10:02   ` Arnd Bergmann
2021-11-09 10:32   ` Andy Shevchenko
2021-11-09 10:32     ` Andy Shevchenko
2021-11-09 10:54     ` Arnd Bergmann
2021-11-09 10:54       ` Arnd Bergmann
2021-11-09 10:02 ` [PATCH v2 8/8] gpiolib: split linux/gpio/driver.h out of linux/gpio.h Arnd Bergmann
2021-11-09 10:02   ` Arnd Bergmann
2021-11-09 10:34   ` Andy Shevchenko
2021-11-09 10:34     ` 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='CAK8P3a0J1f9+o6Uqdn4QeQ=30oW6p+fOaFU7-5L0cW-zihfNxg@mail.gmail.com' \
    --to=arnd@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=brgl@bgdev.pl \
    --cc=geert+renesas@glider.be \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.