From: Carlo Szelinsky <github@szelinsky.de>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>
Cc: "Griffin Kroah-Hartman" <griffin@kroah.com>,
"Marek Behún" <kabel@kernel.org>,
"Álvaro Fernández Rojas" <noltari@gmail.com>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] leds: class: Fix the LED name in the debug message after registering
Date: Sat, 28 Nov 2026 22:52:28 +0100 [thread overview]
Message-ID: <20261128215230.66205-2-github@szelinsky.de> (raw)
In-Reply-To: <20261128215230.66205-1-github@szelinsky.de>
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
next prev parent reply other threads:[~2026-11-28 21:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 21:52 [PATCH 0/3] leds: Fix "(null)" LED names after registering Carlo Szelinsky
2026-11-28 21:52 ` Carlo Szelinsky [this message]
2026-11-28 21:52 ` [PATCH 2/3] leds: syscon: Remove the probe message Carlo Szelinsky
2026-11-28 21:52 ` [PATCH 3/3] leds: bcm6328, bcm6358: Remove the registration debug message Carlo Szelinsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261128215230.66205-2-github@szelinsky.de \
--to=github@szelinsky.de \
--cc=griffin@kroah.com \
--cc=kabel@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=noltari@gmail.com \
--cc=pavel@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox