[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210712061036.550635243@linuxfoundation.org>
Date: Mon, 12 Jul 2021 08:10:51 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Jean-Jacques Hiblot <jjhiblot@...com>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Pavel Machek <pavel@....cz>, Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.12 568/700] leds: class: The -ENOTSUPP should never be seen by user space
From: Andy Shevchenko <andy.shevchenko@...il.com>
[ 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@...com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
Signed-off-by: Pavel Machek <pavel@....cz>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/leds/led-class.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 2e495ff67856..fa3f5f504ff7 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;
--
2.30.2
Powered by blists - more mailing lists