summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorJan H. Schönherr <jschoenh@amazon.de>2017-09-05 23:14:29 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-09-18 13:38:30 +0200
commit41ba8bd0829f5c210715ece8b0f699bed0da8eb5 (patch)
treebcfb1d58c5d26331c10ab39a7d95e5520f8c833f /drivers/base
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
PM / QoS: Use the correct variable to check the QoS request type
Use the actual function argument for the validation of the request type, instead of the type field in a fresh (supposedly zero-initialized) request structure. Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/qos.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index f850daeffba4..277d43a83f53 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -277,11 +277,11 @@ void dev_pm_qos_constraints_destroy(struct device *dev)
mutex_unlock(&dev_pm_qos_sysfs_mtx);
}
-static bool dev_pm_qos_invalid_request(struct device *dev,
- struct dev_pm_qos_request *req)
+static bool dev_pm_qos_invalid_req_type(struct device *dev,
+ enum dev_pm_qos_req_type type)
{
- return !req || (req->type == DEV_PM_QOS_LATENCY_TOLERANCE
- && !dev->power.set_latency_tolerance);
+ return type == DEV_PM_QOS_LATENCY_TOLERANCE &&
+ !dev->power.set_latency_tolerance;
}
static int __dev_pm_qos_add_request(struct device *dev,
@@ -290,7 +290,7 @@ static int __dev_pm_qos_add_request(struct device *dev,
{
int ret = 0;
- if (!dev || dev_pm_qos_invalid_request(dev, req))
+ if (!dev || !req || dev_pm_qos_invalid_req_type(dev, type))
return -EINVAL;
if (WARN(dev_pm_qos_request_active(req),