leds: Provide devm_of_led_get_optional()
authorJean-Jacques Hiblot <jjhiblot@traphandler.com>
Fri, 28 Jul 2023 15:37:28 +0000 (17:37 +0200)
committerLee Jones <lee@kernel.org>
Thu, 17 Aug 2023 08:00:06 +0000 (09:00 +0100)
commitafb48153220d35f330d0d979792920a31f7d9a81
tree54ce29822b21abc872002ab3ac0d4b96bc312965
parent179507fcd5e448eaecae9b69f0fb30965c3c4466
leds: Provide devm_of_led_get_optional()

Add an optional variant of devm_of_led_get(). It behaves the same as
devm_of_led_get() except where the LED doesn't exist. In this case,
instead of returning -ENOENT, the function returns NULL.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230728153731.3742339-2-jjhiblot@traphandler.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/led-class.c
include/linux/leds.h