]> 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)
commit4c1b8bb67233995042cc9e40e0f6288334544321
treec5d49438d687d58d8b147561c8fe6f74877a9b2f
parent18ca123f6ebe35a17ec03d9d706c2e230bcf298a
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: 8338c57b91e7 ("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