Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4687f953 authored by Fenglin Wu's avatar Fenglin Wu Committed by Subbaraman Narayanamurthy
Browse files

leds: triggers: Don't remove trigger if LED_KEEP_TRIGGER flag is set



Currently, 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.

Change-Id: I2f3e7bf07b3191a8224732163b67dbd726b76c3b
Signed-off-by: default avatarFenglin Wu <fenglinw@codeaurora.org>
parent b827b53c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -44,7 +44,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;
	}