On Tue, Aug 19, 2025, at 14:19, Lee Jones wrote:
> On 2025年8月08日, 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.
Arnd
$ git grep -wl struct.gpio_led
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-orion5x/board-d2net.c
arch/arm/mach-orion5x/dns323-setup.c
arch/arm/mach-orion5x/mv2120-setup.c
arch/arm/mach-orion5x/net2big-setup.c
arch/arm/mach-orion5x/ts409-setup.c
arch/arm/mach-s3c/mach-crag6410.c
arch/arm/mach-sa1100/assabet.c
arch/mips/alchemy/board-gpr.c
arch/mips/alchemy/board-mtx1.c
arch/mips/bcm47xx/leds.c
arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
arch/mips/loongson32/ls1b/board.c
arch/mips/txx9/generic/setup.c
arch/mips/txx9/rbtx4927/setup.c
arch/powerpc/platforms/44x/warp.c
arch/sh/boards/mach-rsk/devices-rsk7203.c
drivers/leds/leds-gpio.c
drivers/leds/simatic/simatic-ipc-leds-gpio-core.c
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/leds.c
drivers/platform/x86/barco-p50-gpio.c
drivers/platform/x86/intel/atomisp2/led.c
drivers/platform/x86/meraki-mx100.c
drivers/platform/x86/pcengines-apuv2.c
drivers/platform/x86/sel3350-platform.c