OSDN Git Service

leds: class: The -ENOTSUPP should never be seen by user space
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Mon, 10 May 2021 09:50:18 +0000 (12:50 +0300)
committerPavel Machek <pavel@ucw.cz>
Fri, 28 May 2021 09:59:59 +0000 (11:59 +0200)
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>
drivers/leds/led-class.c

index 16271a1..f704391 100644 (file)
@@ -285,10 +285,6 @@ struct led_classdev *__must_check devm_of_led_get(struct device *dev,
        if (!dev)
                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);
        if (IS_ERR(led))
                return led;