summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorAndy Shevchenko <andy.shevchenko@gmail.com>2021-05-10 12:50:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 16:56:39 +0200
commitb504e279e5029f9b5e0e1f4f68f8fd6675d48ff6 (patch)
treea9bb72501b361e9c0ca24a8547ca981c8904a1df /drivers/leds
parent58279b341b9422d73bee1b10a7fa7f4dca006142 (diff)
leds: class: The -ENOTSUPP should never be seen by user space
[ Upstream commit 0ac40af86077982a5346dbc9655172d2775d6b08 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/led-class.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 131ca83f5fb3..4365c1cc4505 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -286,10 +286,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;