The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/3] leds: class: Fix the LED name in the debug message after registering
  2026-11-28 21:52 [PATCH 0/3] leds: Fix "(null)" LED names " Carlo Szelinsky
@ 2026-11-28 21:52 ` Carlo Szelinsky
  0 siblings, 0 replies; 2+ messages in thread
From: Carlo Szelinsky @ 2026-11-28 21:52 UTC (permalink / raw)
  To: Lee Jones, Pavel Machek
  Cc: Griffin Kroah-Hartman, Marek Behún,
	Álvaro Fernández Rojas, linux-leds, linux-kernel

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@szelinsky.de>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] leds: class: Fix the LED name in the debug message after registering
       [not found] <sashiko-outbox-239056@kernel.org>
@ 2026-12-02 17:37 ` Carlo Szelinsky
  0 siblings, 0 replies; 2+ messages in thread
From: Carlo Szelinsky @ 2026-12-02 17:37 UTC (permalink / raw)
  To: sashiko-reviews
  Cc: Lee Jones, Pavel Machek, Griffin Kroah-Hartman, Marek Behún,
	Álvaro Fernández Rojas, linux-leds, linux-kernel

On Sat, 28 Nov 2026 21:56, sashiko-bot@kernel.org wrote:
> This problem wasn't introduced by this patch, but can led_trigger_read()
> call down_read() on led_cdev->trigger_lock before it is initialized [1]?

Right, but this is not from this patch, and it is already fixed in
for-leds-next by c7536e916bb3 ("leds: class: Initialise trigger_lock
before exposing sysfs attributes").

Carlo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-02 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <sashiko-outbox-239056@kernel.org>
2026-12-02 17:37 ` [PATCH 1/3] leds: class: Fix the LED name in the debug message after registering Carlo Szelinsky
2026-11-28 21:52 [PATCH 0/3] leds: Fix "(null)" LED names " Carlo Szelinsky
2026-11-28 21:52 ` [PATCH 1/3] leds: class: Fix the LED name in the debug message " Carlo Szelinsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox