lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <e9252384-a55c-4a91-9c61-06e05a0b2ce4@app.fastmail.com>
Date: Tue, 19 Aug 2025 14:59:34 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Lee Jones" <lee@...nel.org>, "Arnd Bergmann" <arnd@...nel.org>
Cc: "Bartosz Golaszewski" <brgl@...ev.pl>,
 "Linus Walleij" <linus.walleij@...aro.org>,
 "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
 "Pavel Machek" <pavel@...nel.org>,
 "Javier Carrasco" <javier.carrasco.cruz@...il.com>,
 "Gustavo A. R. Silva" <gustavoars@...nel.org>,
 "Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>,
 "Kees Cook" <kees@...nel.org>, "Anish Kumar" <yesanishhere@...il.com>,
 "Mukesh Ojha" <quic_mojha@...cinc.com>,
 "Thomas Zimmermann" <tzimmermann@...e.de>,
 "Dmitry Rokosov" <ddrokosov@...utedevices.com>, linux-leds@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH 10/21] leds: gpio: make legacy gpiolib interface optional

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.

     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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ