Re: [PATCH 0/2] Fall back to using software node name as LED name

Lee Jones
2026-03-25T13:38:40Z

On Wed, 11 Mar 2026, Dmitry Torokhov wrote:

> This allows setting just name in software node representing an LED
> instance and forego "label" or other properties needed to form a name.
> This is helpful when converting old boards using bespoke platform data
> to software nodes/static device properties.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> Dmitry Torokhov (2):
> leds: core: implement fallback to software node name for LED names
> leds: core: fix formatting issues
>
> drivers/leds/led-core.c | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
> ---
> base-commit: 7109a2155340cc7b21f27e832ece6df03592f2e8
> change-id: 20260311-led-swnode-name-6db2e5757071

I'm happy with the set, but it failed to apply to leds-next.

diff a/drivers/leds/led-core.c b/drivers/leds/led-core.c (rejected hunks)
@@ -584,8 +582,9 @@ int led_compose_name(struct device *dev, struct led_init_data *init_data,
} else if (is_software_node(fwnode)) {
n = snprintf(led_classdev_name, LED_MAX_NAME_SIZE, "%s",
fwnode_get_name(fwnode));
- } else
+ } else {
return -EINVAL;
+ }

if (n >= LED_MAX_NAME_SIZE)
return -E2BIG;

Please rebase and [RESEND].

--
Lee Jones [李琼斯]