Re: [RFC PATCH 1/2] leds: core: Add support for led-instance property

Jonathan Brophy
2025-12-28T18:43:20Z

>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

Good point! You're right that function-enumerator and led-instance could
conflict. I'll make them mutually exclusive.

The semantic difference is:
- function-enumerator: Numeric instances (0, 1, 2...) → "lan:green-5"
- led-instance: Semantic instances ("port23") → "lan:green:port23"

Having both would create "lan:green-5:port23" which is confusing.

I can add validation to reject DT nodes that specify both:

if (props->func_enum_present && instance) {
dev_err(dev, "'led-instance' and 'function-enumerator' are mutually exclusive\n");
return -EINVAL;
}

And document this in the DT binding:

"This property cannot be used together with function-enumerator.
Use function-enumerator for numeric instances (0, 1, 2) or
led-instance for semantic instances (port0, battery, usb)."

would this be ok ?