"Arnd Bergmann" <arnd@xxxxxxxx> writes: > On Thu, Feb 1, 2024, at 14:17, Andy Shevchenko wrote: >> On Thu, Feb 01, 2024 at 01:20:16PM +0100, Arnd Bergmann wrote: >>> On Wed, Jan 31, 2024, at 23:37, Linus Walleij wrote: >> >>> + } else if (ah->led_pin < 0) { >> >> ... >> >>> + if (sc->sc_ah->led_gpio) >> >> Dup check > > I don't know what you mean here. To explain what I'm > trying to do: The idea is that the LED is always backed > by either gpiolib or the internal gpio controller on > the PCI device. This means every access to an LED must > be guarded with > > if (gpiodesc) > gpio_*(gpiodesc); > else > internal(ah); > > We could probably go a little further in the cleanup and > throw out the gpiolib path entirely, instead relying > on the existing leds-gpio driver. Since there are currently > no upstream users of the gpiolib path, that would likely > lead to cleaner code but require more changes to any > out-of-tree users that rely on the platform_data to > pass the GPIOs today. There being exactly one such out of tree user (per your up-thread email) in OpenWrt? Or are you aware of others? -Toke