summaryrefslogtreecommitdiff
path: root/drivers/base/power/sysfs.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-31 20:26:15 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-10-31 20:35:40 +0300
commitd5919dcc349d2a16d805ef8096d36e4f519e42ae (patch)
tree583956db5482efb7b38a0eddb51bac5b63db051d /drivers/base/power/sysfs.c
parent5ba257249e9c8cb2c670e22b0f02d1806f349102 (diff)
downloadlinux-d5919dcc349d2a16d805ef8096d36e4f519e42ae.tar.xz
Revert "PM / QoS: Fix device resume latency PM QoS"
This reverts commit 0cc2b4e5a020 (PM / QoS: Fix device resume latency PM QoS) as it introduced regressions on multiple systems and the fix-up in commit 2a9a86d5c813 (PM / QoS: Fix default runtime_pm device resume latency) does not address all of them. The original problem that commit 0cc2b4e5a020 was attempting to fix will be addressed later. Fixes: 0cc2b4e5a020 (PM / QoS: Fix device resume latency PM QoS) Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/power/sysfs.c')
-rw-r--r--drivers/base/power/sysfs.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
index 632077f05c57..156ab57bca77 100644
--- a/drivers/base/power/sysfs.c
+++ b/drivers/base/power/sysfs.c
@@ -218,14 +218,7 @@ static ssize_t pm_qos_resume_latency_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- s32 value = dev_pm_qos_requested_resume_latency(dev);
-
- if (value == 0)
- return sprintf(buf, "n/a\n");
- else if (value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
- value = 0;
-
- return sprintf(buf, "%d\n", value);
+ return sprintf(buf, "%d\n", dev_pm_qos_requested_resume_latency(dev));
}
static ssize_t pm_qos_resume_latency_store(struct device *dev,
@@ -235,21 +228,11 @@ static ssize_t pm_qos_resume_latency_store(struct device *dev,
s32 value;
int ret;
- if (!kstrtos32(buf, 0, &value)) {
- /*
- * Prevent users from writing negative or "no constraint" values
- * directly.
- */
- if (value < 0 || value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
- return -EINVAL;
+ if (kstrtos32(buf, 0, &value))
+ return -EINVAL;
- if (value == 0)
- value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
- } else if (!strcmp(buf, "n/a") || !strcmp(buf, "n/a\n")) {
- value = 0;
- } else {
+ if (value < 0)
return -EINVAL;
- }
ret = dev_pm_qos_update_request(dev->power.qos->resume_latency_req,
value);