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

Commit 040e5bf6 authored by Arve Hjønnevåg's avatar Arve Hjønnevåg Committed by Rafael J. Wysocki
Browse files

PM / Sleep: Fix a mistake in a conditional in autosleep_store()



The condition check in autosleep_store() is incorrect and prevents
/sys/power/autosleep from working as advertised.  Fix that.

[rjw: Added the changelog.]

Signed-off-by: default avatarArve Hjønnevåg <arve@android.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 4d7e30d9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -422,7 +422,7 @@ static ssize_t autosleep_store(struct kobject *kobj,
	int error;

	if (state == PM_SUSPEND_ON
	    && !(strncmp(buf, "off", 3) && strncmp(buf, "off\n", 4)))
	    && strcmp(buf, "off") && strcmp(buf, "off\n"))
		return -EINVAL;

	error = pm_autosleep_set_state(state);