]> git.baikalelectronics.ru Git - kernel.git/commit
leds: gpio: Fix uninitialized gpio label for fwnode based probe
authorJacek Anaszewski <jacek.anaszewski@gmail.com>
Thu, 5 Dec 2019 21:25:01 +0000 (22:25 +0100)
committerPavel Machek <pavel@ucw.cz>
Wed, 22 Jan 2020 20:06:25 +0000 (21:06 +0100)
commit2faf4678882c81115a1606780a49878c5aac23a8
treec5d49438d687d58d8b147561c8fe6f74877a9b2f
parent498b47670c5ee1c0b4be596eefcfb035b76ac53e
leds: gpio: Fix uninitialized gpio label for fwnode based probe

When switching to using generic LED name composition mechanism via
devm_led_classdev_register_ext() API the part of code initializing
struct gpio_led's template name property was removed alongside.
It was however overlooked that the property was also passed to
devm_fwnode_get_gpiod_from_child() in place of "label" parameter,
which when set to NULL, results in gpio label being initialized to '?'.

It could be observed in debugfs and failed to properly identify
gpio association with LED consumer.

Fix this shortcoming by updating the GPIO label after the LED is
registered and its final name is known.

Fixes: c78d0b42a63b ("leds: gpio: Use generic support for composing LED names")
Cc: Russell King <linux@armlinux.org.uk>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
[fixed comment]
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/leds-gpio.c