[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1565398367-11811-2-git-send-email-gurus@codeaurora.org>
Date: Fri, 9 Aug 2019 17:52:47 -0700
From: Guru Das Srinagesh <gurus@...eaurora.org>
To: linux-leds@...r.kernel.org
Cc: Jacek Anaszewski <jacek.anaszewski@...il.com>,
Pavel Machek <pavel@....cz>, Dan Murphy <dmurphy@...com>,
linux-kernel@...r.kernel.org, Fenglin Wu <fenglinw@...eaurora.org>,
Guru Das Srinagesh <gurus@...eaurora.org>
Subject: [PATCH 2/2] leds: triggers: Don't remove trigger if LED_KEEP_TRIGGER flag is set
From: Fenglin Wu <fenglinw@...eaurora.org>
The LED_KEEP_TRIGGER flag prevents the trigger being removed while
turning off the LEDs. Extend the flag usage to prevent the trigger being
removed even while "none" trigger is set.
Signed-off-by: Fenglin Wu <fenglinw@...eaurora.org>
Signed-off-by: Guru Das Srinagesh <gurus@...eaurora.org>
---
drivers/leds/led-triggers.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 8d11a5e..a0e4531 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -40,7 +40,8 @@ ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
goto unlock;
}
- if (sysfs_streq(buf, "none")) {
+ if (sysfs_streq(buf, "none") &&
+ !(led_cdev->flags & LED_KEEP_TRIGGER)) {
led_trigger_remove(led_cdev);
goto unlock;
}
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists