summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2012-05-04 00:14:21 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-05 21:50:58 +0200
commit040e5bf65e1ee66266bc314c5965518a7c21ff36 (patch)
treece2dce378ae0f765b6534a7cec0a5529ee09930b /kernel/power
parent4d7e30d98939a0340022ccd49325a3d70f7e0238 (diff)
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: Arve Hjønnevåg <arve@android.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 54ec071de337..428f8a034e96 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -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);