[PATCH RFT v7 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors

Linus Walleij linus.walleij at linaro.org
Tue Oct 10 13:04:14 PDT 2023


On Tue, Oct 10, 2023 at 7:39 PM Bartosz Golaszewski <brgl at bgdev.pl> wrote:

> It doesn't seem like anyone is using these GPIOs once they're
> requested? Wouldn't the above definitios be analogous to:
>
> GPIO_HOG("pxa-gpio", SPITZ_GPIO_LED_ORANGE, NULL, GPIO_ACTIVE_HIGH, GPIOD_ASIS)
> GPIO_HOG("pxa-gpio", SPITZ_GPIO_LED_GREEN, NULL, GPIO_ACTIVE_HIGH, GPIOD_ASIS)

They are used:
+       spitz_gpio_leds[0].gpiod = leds->desc[0];
+       spitz_gpio_leds[1].gpiod = leds->desc[1];

The descriptors are passed to the leds-gpio driver.

But wait: no.

This whole thing:

+static struct gpio_descs *leds;
+
(...)
+       leds = gpiod_get_array_optional(&spitz_led_device.dev,
+                       NULL, GPIOD_ASIS);
+       spitz_gpio_leds[0].gpiod = leds->desc[0];
+       spitz_gpio_leds[1].gpiod = leds->desc[1];

Just delete all that.

The leds-gpio driver will request and use the lines.

It was just so unorthodox that I missed it. Adding the descriptor
table is enough.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list