summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorLee Jones <lee@kernel.org>2024-07-04 19:07:01 +0300
committerLee Jones <lee@kernel.org>2024-07-04 19:07:01 +0300
commit5ffe70d81e08cc101e9d609f69fd587e2bed4b8c (patch)
tree3253ab882c7beacc0d32d9234c184bcf4ff5829a /drivers/leds
parentf5ace555243953d12031679712e8594a40873ed0 (diff)
parent970c3a6b7aa3c68ccdf5af2562c3d39533dd62a9 (diff)
downloadlinux-5ffe70d81e08cc101e9d609f69fd587e2bed4b8c.tar.xz
Merge branch 'ib-mfd-leds-platform-6.11' into ibs-for-mfd-merged
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/led-class.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 24fcff682b24..2f08c20702f3 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -503,6 +503,11 @@ int led_classdev_register_ext(struct device *parent,
ret = led_classdev_next_name(proposed_name, final_name, sizeof(final_name));
if (ret < 0)
return ret;
+ else if (ret && led_cdev->flags & LED_REJECT_NAME_CONFLICT)
+ return -EEXIST;
+ else if (ret)
+ dev_warn(parent, "Led %s renamed to %s due to name collision\n",
+ proposed_name, final_name);
if (led_cdev->color >= LED_COLOR_ID_MAX)
dev_warn(parent, "LED %s color identifier out of range\n", final_name);
@@ -518,10 +523,6 @@ int led_classdev_register_ext(struct device *parent,
if (init_data && init_data->fwnode)
device_set_node(led_cdev->dev, init_data->fwnode);
- if (ret)
- dev_warn(parent, "Led %s renamed to %s due to name collision",
- proposed_name, dev_name(led_cdev->dev));
-
if (led_cdev->flags & LED_BRIGHT_HW_CHANGED) {
ret = led_add_brightness_hw_changed(led_cdev);
if (ret) {