All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] led-triggers: allow writing 'default' to sysfs trigger attr
@ 2017-11-28  6:38 Craig McQueen
  2017-11-28 12:07 ` Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Craig McQueen @ 2017-11-28  6:38 UTC (permalink / raw)
  To: linux-leds; +Cc: Craig McQueen

It calls led_trigger_set_default() to set the LED to its default
trigger.
---
 drivers/leds/led-triggers.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 431123b048a2..f090a7806017 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -49,6 +49,11 @@ ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
 		goto unlock;
 	}
 
+	if (sysfs_streq(buf, "default")) {
+		led_trigger_set_default(led_cdev);
+		goto unlock;
+	}
+
 	down_read(&triggers_list_lock);
 	list_for_each_entry(trig, &trigger_list, next_trig) {
 		if (sysfs_streq(buf, trig->name)) {
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-28 19:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-28  6:38 [PATCH] led-triggers: allow writing 'default' to sysfs trigger attr Craig McQueen
2017-11-28 12:07 ` Pavel Machek
2017-11-28 19:38   ` Jacek Anaszewski
2017-11-28 19:38   ` Jacek Anaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.