Skip to content

Commit

Permalink
leds: class: The -ENOTSUPP should never be seen by user space
Browse files Browse the repository at this point in the history
[ Upstream commit 0ac40af ]

Drop the bogus error code and let of_led_get() to take care about absent
of_node.

Fixes: e389240 ("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>
  • Loading branch information
andy-shev authored and gregkh committed Jul 14, 2021
1 parent 58279b3 commit b504e27
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/leds/led-class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b504e27

Please sign in to comment.