Re: [RFC PATCH 1/2] leds: core: Add support for led-instance property
From: Andriy Shevencho
Date: Sun Dec 28 2025 - 13:36:01 EST
On Mon, Dec 29, 2025 at 07:22:44AM +1300, Jonathan Brophy wrote:
> From: Jonathan Brophy <professor_jonny@xxxxxxxxxxx>
>
> Add support for parsing an optional "led-instance" device tree property
> that provides a third component in LED naming for deterministic
> identification when multiple LEDs share the same function and color.
>
> The led-instance becomes part of the LED name as:
> color:function:instance
>
> This solves the non-deterministic _1, _2 suffix problem for hardware
> with many identical LEDs (e.g., 48-port network switches).
> +parse_instance:
> + /* Parse optional instance identifier */
> + if (fwnode_property_present(fwnode, "led-instance")) {
> + ret = fwnode_property_read_string(fwnode, "led-instance", instance);
> + if (ret)
> + dev_err(dev, "Error parsing 'led-instance' property (%d)\n", ret);
> + }
> }
But this will be called unconditionally even if the
function/function-enumerator is present. Wouldn't these be conflicting options?
--
With Best Regards,
Andy Shevchenko