Re: [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional
From: Lee Jones
Date: Wed Aug 20 2025 - 03:17:36 EST
On Tue, 19 Aug 2025, Arnd Bergmann wrote:
> On Tue, Aug 19, 2025, at 14:19, Lee Jones wrote:
> > On Fri, 08 Aug 2025, Arnd Bergmann wrote:
> >> {
> >> struct gpio_desc *gpiod;
> >> +#ifdef CONFIG_GPIOLIB_LEGACY
> >> int ret;
> >> +#endif
> >
> > Isn't there another way to do his that doesn't entail sprinkling #ifery
> > around C-files?
> >
>
> An alternativew would be to duplicate the driver and have
> one modern variant and an additional legacy variant that
> is only used on the few remaining platforms that select CONFIG_GPIOLIB_LEGACY and define platform data. See below
> for the list of files that reference struct gpio_led.
>
> There are already patches to convert some of those to
> software nodes, and a lot of the others can probably be
> removed, in particular the orion5x ones.
>
> The leds-gpio driver with just the legacy interfaces left
> would be a really small driver, and removing those bits from
> the normal one would make that a bit simpler as well, but
> there would be some amount of duplication.
Sounds like we're between a rock and a hard place with this.
Will the legacy parts be removed at some point or do you foresee us
supporting this forever?
--
Lee Jones [李琼斯]