OSDN Git Service

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)
commit90a8e82d3ca8c1f85ac63f4a94c9b034f05af4ee
treec5d49438d687d58d8b147561c8fe6f74877a9b2f
parentd1eef1c619749b2a57e514a3fa67d9a516ffa919
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: d7235f5feaa0 ("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