• Jacek Anaszewski's avatar
    leds: gpio: Fix uninitialized gpio label for fwnode based probe · 90a8e82d
    Jacek Anaszewski authored
    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: d7235f5f ("leds: gpio: Use generic support for composing LED names")
    Cc: Russell King <linux@armlinux.org.uk>
    Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    Signed-off-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
    [fixed comment]
    Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
    90a8e82d
leds-gpio.c 8.32 KB