Re: [PATCH] [v2] leds: gpio: make legacy gpiolib interface optional

Linus Walleij
2026-05-05T12:31:24Z

On Thu, Apr 30, 2026 at 11:12 AM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> There are still a handful of ancient mips/armv5/sh boards that use the
> gpio_led:gpio member to pass an old-style gpio number, but all modern
> users have been converted to gpio descriptors.
>
> While the CONFIG_GPIOLIB_LEGACY option that guards devm_gpio_request_one()
> and related helpers is currently turned on in all kernel builds,
> the plan is to only enable it on the few platforms that actually
> pass gpio numbers in any platform_data.
>
> Split out the legacy portion of the platform_data handling into a custom
> helper function that is guarded with in #ifdef block, to allow the
> the leds-gpio driver to compile cleanly when CONFIG_GPIOLIB_LEGACY
> gets turned off. Once the last user is converted, this function can
> be removed.
>
> Link: https://lore.kernel.org/all/e9252384-a55c-4a91-9c61-06e05a0b2ce4@app.fastmail.com/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: rework a little bit to keep the legacy code path more separate,
> extend changelog description
>
> Related to this, we may also want to remove support for passing
> a gpio descriptor in the ->gpiod flag. The only user doing this
> at the moment was introduced in commit 1892e87a3e91 ("powerpc/warp:
> switch to using gpiod API").
>
> Linus Walleij previously gave a Reviewed-by tag, but I dropped
> it again during the rework.

You can have it back :)
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij