[PATCH 1/3] leds: class: Fix the LED name in the debug message after registering
From: Carlo Szelinsky
Date: Sat Nov 28 2026 - 16:52:50 EST
When a driver passes init_data, led_classdev_register_ext() builds the
LED name in a local buffer and does not set led_cdev->name. Drivers
that use init_data usually leave it unset. The debug message at the
end still prints led_cdev->name, so it says
"Registered led device: (null)".
Print the name of the LED device instead.
Fixes: bb4e9af0348d ("leds: core: Add support for composing LED class device names")
Signed-off-by: Carlo Szelinsky <github@xxxxxxxxxxxx>
---
drivers/leds/led-class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 00be3cb96c00..23d692035150 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -586,7 +586,7 @@ int led_classdev_register_ext(struct device *parent,
mutex_unlock(&led_cdev->led_access);
dev_dbg(parent, "Registered led device: %s\n",
- led_cdev->name);
+ dev_name(led_cdev->dev));
return 0;
}
--
2.43.0