mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
leds: gpio: Clear error pointers for skipped LEDs
gpio_led_get_gpiod() returns an error pointer when a platform-data
LED's GPIO is unavailable. gpio_led_probe() skips registration in that
case, but leaves the error pointer in led_dat->gpiod.
The skipped entry remains included in priv->num_leds. During shutdown,
gpio_led_shutdown() walks those entries and passes the error pointer to
gpio_led_set(), producing:
gpiod_set_value: invalid GPIO (errorpointer: -ENOENT)
Clear led_dat->gpiod before skipping the LED so skipped entries do not
retain error-valued descriptors.
Fixes: 45d4c6de4e ("leds: gpio: Try to lookup gpiod from device")
Suggested-by: Lee Jones <lee@kernel.org>
Assisted-by: ChatGPT:GPT-5.5-Thinking
Signed-off-by: Steve Dunnagan <sdunnaga@redhat.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260724180412.43150-1-sdunnaga@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
95231a9225
commit
942901eeda
|
|
@ -296,6 +296,7 @@ static int gpio_led_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(led_dat->gpiod)) {
|
||||
dev_info(dev, "Skipping unavailable LED gpio %s\n",
|
||||
template->name);
|
||||
led_dat->gpiod = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user