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:24 +0300
committerJacek Anaszewski <jacek.anaszewski@gmail.com>2018-07-06 00:21:11 +0300
commita0b750768371e410d77b60bcf49c18bd45078d55 (patch)
tree1d523ab7ccdfdf41823b480ca6c8c98bee90ac84 /include/linux/leds.h
parenta7d5904a6f44e0da05d62197521ec7d96cebb6aa (diff)
downloadlinux-a0b750768371e410d77b60bcf49c18bd45078d55.tar.xz
leds: triggers: define module_led_trigger helper
This helps to simplify modules that provide a simple led_trigger. It's inspired by module_platform_driver, module_i2c_driver et al. 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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 33484a5c7478..a3ee10846a4b 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -326,6 +326,10 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
extern void led_trigger_rename_static(const char *name,
struct led_trigger *trig);
+#define module_led_trigger(__led_trigger) \
+ module_driver(__led_trigger, led_trigger_register, \
+ led_trigger_unregister)
+
#else
/* Trigger has no members */