Commit af4c720e authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Rafael J. Wysocki

PM / QoS: Properly use the WARN() macro in dev_pm_qos_add_request()

Make dev_pm_qos_add_request() use WARN() in a better way and do not hardcode
the function's name into the message (use __func__ instead).
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 24050956
......@@ -212,11 +212,9 @@ int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
if (!dev || !req) /*guard against callers passing in null */
return -EINVAL;
if (dev_pm_qos_request_active(req)) {
WARN(1, KERN_ERR "dev_pm_qos_add_request() called for already "
"added request\n");
if (WARN(dev_pm_qos_request_active(req),
"%s() called for already added request\n", __func__))
return -EINVAL;
}
req->dev = dev;
......@@ -271,11 +269,9 @@ int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
if (!req) /*guard against callers passing in null */
return -EINVAL;
if (!dev_pm_qos_request_active(req)) {
WARN(1, KERN_ERR "dev_pm_qos_update_request() called for "
"unknown object\n");
if (WARN(!dev_pm_qos_request_active(req),
"%s() called for unknown object\n", __func__))
return -EINVAL;
}
mutex_lock(&dev_pm_qos_mtx);
......@@ -312,11 +308,9 @@ int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
if (!req) /*guard against callers passing in null */
return -EINVAL;
if (!dev_pm_qos_request_active(req)) {
WARN(1, KERN_ERR "dev_pm_qos_remove_request() called for "
"unknown object\n");
if (WARN(!dev_pm_qos_request_active(req),
"%s() called for unknown object\n", __func__))
return -EINVAL;
}
mutex_lock(&dev_pm_qos_mtx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment