diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2021-05-10 12:50:18 +0300 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2021-05-28 11:59:59 +0200 |
commit | 0ac40af86077982a5346dbc9655172d2775d6b08 (patch) | |
tree | a48d130f8b9aefb0afdda846a59295a6c11adc95 /drivers/leds | |
parent | db30c91add87fb49a63798e204c467e611dc2718 (diff) | |
download | linux-stable-0ac40af86077982a5346dbc9655172d2775d6b08.tar.gz linux-stable-0ac40af86077982a5346dbc9655172d2775d6b08.tar.bz2 linux-stable-0ac40af86077982a5346dbc9655172d2775d6b08.zip |
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>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/led-class.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index 16271a1de12a..f704391d57a8 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -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; |