Skip to content

Commit

Permalink
PM / devfreq: Fix handling dev_pm_qos_remove_request result
Browse files Browse the repository at this point in the history
The dev_pm_qos_remove_request function can return 1 if
"aggregated constraint value has changed" so only negative values should
be reported as errors.

Fixes: 27dbc54 ("PM / devfreq: Use PM QoS for sysfs min/max_freq")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Leonard Crestez authored and Chanwoo Choi committed Mar 24, 2020
1 parent 3bb5ee9 commit 4c6abef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
@@ -705,13 +705,13 @@ static void devfreq_dev_release(struct device *dev)

if (dev_pm_qos_request_active(&devfreq->user_max_freq_req)) {
err = dev_pm_qos_remove_request(&devfreq->user_max_freq_req);
if (err)
if (err < 0)
dev_warn(dev->parent,
"Failed to remove max_freq request: %d\n", err);
}
if (dev_pm_qos_request_active(&devfreq->user_min_freq_req)) {
err = dev_pm_qos_remove_request(&devfreq->user_min_freq_req);
if (err)
if (err < 0)
dev_warn(dev->parent,
"Failed to remove min_freq request: %d\n", err);
}

0 comments on commit 4c6abef

Please sign in to comment.