Re: [PATCH 2/4] led: class: Add devm_fwnode_led_get() to get a LED from a firmware node

From: Andy Shevchenko
Date: Wed Jun 15 2022 - 11:55:37 EST


On Wed, Jun 15, 2022 at 5:49 PM Jean-Jacques Hiblot
<jjhiblot@xxxxxxxxxxxxxxx> wrote:
>
> Same functionality as devm_of_led_get(), but it takes a firmware node
> as a parameter.
> This mimic devm_fwnode_pwm_get() found in the PWM core.
>
> The ACPI implementation is missing and the function returns -EOPNOTSUPP
> when the firmware node is actually an ACPI node.

...

> + if (is_of_node(fwnode))
> + led = of_led_get(to_of_node(fwnode), index);
> + else if (is_acpi_node(fwnode))
> + /* ACPI support is not yet implemented */
> + led = ERR_PTR(-EOPNOTSUPP);
> + if (IS_ERR(led))
> + return led;

Yeah, acpi.h is needed here and it needs to be ordered, I guess should
be added somewhere at the top of the header block.

--
With Best Regards,
Andy Shevchenko