summaryrefslogtreecommitdiffstats
path: root/drivers/leds/led-class.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/led-class.c')
-rw-r--r--drivers/leds/led-class.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index ba1be15cfd..24fcff682b 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -552,6 +552,12 @@ int led_classdev_register_ext(struct device *parent,
led_init_core(led_cdev);
#ifdef CONFIG_LEDS_TRIGGERS
+ /*
+ * If no default trigger was given and hw_control_trigger is set,
+ * make it the default trigger.
+ */
+ if (!led_cdev->default_trigger && led_cdev->hw_control_trigger)
+ led_cdev->default_trigger = led_cdev->hw_control_trigger;
led_trigger_set_default(led_cdev);
#endif