leds: class: The -ENOTSUPP should never be seen by user space
Drop the bogus error code and let of_led_get() to take care about absent of_node. Fixes: e389240ad992 ("leds: Add managed API to get a LED from a device driver") Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
This commit is contained in:
parent
db30c91add
commit
0ac40af860
@ -285,10 +285,6 @@ struct led_classdev *__must_check devm_of_led_get(struct device *dev,
|
|||||||
if (!dev)
|
if (!dev)
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
/* Not using device tree? */
|
|
||||||
if (!IS_ENABLED(CONFIG_OF) || !dev->of_node)
|
|
||||||
return ERR_PTR(-ENOTSUPP);
|
|
||||||
|
|
||||||
led = of_led_get(dev->of_node, index);
|
led = of_led_get(dev->of_node, index);
|
||||||
if (IS_ERR(led))
|
if (IS_ERR(led))
|
||||||
return led;
|
return led;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user