Skip to content

Commit

Permalink
leds: core: Fix warning message when init_data
Browse files Browse the repository at this point in the history
The warning message when a led is renamed due to name collition can fail
to show proper original name if init_data is used. Eg:

[    9.073996] leds-gpio a0040000.leds_0: Led (null) renamed to red_led_1 due to name collision

Fixes: bb4e9af ("leds: core: Add support for composing LED class device names")
Signed-off-by: Ricardo Ribalda Delgado <[email protected]>
Acked-by: Jacek Anaszewski <[email protected]>
Signed-off-by: Pavel Machek <[email protected]>
  • Loading branch information
ribalda authored and pavelmachek committed Apr 6, 2020
1 parent 4b37883 commit 64ed658
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/leds/led-class.c
Original file line number Diff line number Diff line change
@@ -376,7 +376,7 @@ int led_classdev_register_ext(struct device *parent,

if (ret)
dev_warn(parent, "Led %s renamed to %s due to name collision",
led_cdev->name, dev_name(led_cdev->dev));
proposed_name, dev_name(led_cdev->dev));

if (led_cdev->flags & LED_BRIGHT_HW_CHANGED) {
ret = led_add_brightness_hw_changed(led_cdev);

0 comments on commit 64ed658

Please sign in to comment.