summaryrefslogtreecommitdiff
path: root/include/linux/leds.h
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2018-07-02 23:05:25 +0300
committerJacek Anaszewski <jacek.anaszewski@gmail.com>2018-07-06 00:21:11 +0300
commit9acc560de2aac73ef99c54f0fdfb86b4684296b5 (patch)
tree65c55f4de04e970dcec30c6196d04b3446206ffd /include/linux/leds.h
parenta0b750768371e410d77b60bcf49c18bd45078d55 (diff)
downloadlinux-9acc560de2aac73ef99c54f0fdfb86b4684296b5.tar.xz
leds: triggers: new function led_set_trigger_data()
This is the natural counter part to the already existing led_get_trigger_data(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Diffstat (limited to 'include/linux/leds.h')
-rw-r--r--include/linux/leds.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index a3ee10846a4b..834683d603f9 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -303,6 +303,12 @@ extern int led_trigger_set(struct led_classdev *led_cdev,
struct led_trigger *trigger);
extern void led_trigger_remove(struct led_classdev *led_cdev);
+static inline void led_set_trigger_data(struct led_classdev *led_cdev,
+ void *trigger_data)
+{
+ led_cdev->trigger_data = trigger_data;
+}
+
static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
{
return led_cdev->trigger_data;
@@ -356,6 +362,7 @@ static inline int led_trigger_set(struct led_classdev *led_cdev,
}
static inline void led_trigger_remove(struct led_classdev *led_cdev) {}
+static inline void led_set_trigger_data(struct led_classdev *led_cdev) {}
static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
{
return NULL;