leds: Add managed API to get a LED from a device driver

If the LED is acquired by a consumer device with devm_led_get(), it is
automatically released when the device is detached.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
This commit is contained in:
Jean-Jacques Hiblot 2019-10-03 10:28:10 +02:00 committed by Pavel
parent 699a8c7c4b
commit e389240ad9
2 changed files with 51 additions and 0 deletions

View file

@ -199,6 +199,8 @@ void led_classdev_resume(struct led_classdev *led_cdev);
extern struct led_classdev *of_led_get(struct device_node *np, int index);
extern void led_put(struct led_classdev *led_cdev);
struct led_classdev *__must_check devm_of_led_get(struct device *dev,
int index);
/**
* led_blink_set - set blinking with software fallback