Skip to content

Commit 5209d1b

Browse files
Yuan Canrafaeljw
authored andcommitted
powercap: dtpm_devfreq: Fix error check against dev_pm_qos_add_request()
The caller of the function dev_pm_qos_add_request() checks again a non zero value but dev_pm_qos_add_request() can return '1' if the request already exists. Therefore, the setup function fails while the QoS request actually did not failed. Fix that by changing the check against a negative value like all the other callers of the function. Fixes: e446556 ("powercap/drivers/dtpm: Add dtpm devfreq with energy model support") Signed-off-by: Yuan Can <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Subject edit ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 42f7652 commit 5209d1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/powercap/dtpm_devfreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int __dtpm_devfreq_setup(struct devfreq *devfreq, struct dtpm *parent)
178178
ret = dev_pm_qos_add_request(dev, &dtpm_devfreq->qos_req,
179179
DEV_PM_QOS_MAX_FREQUENCY,
180180
PM_QOS_MAX_FREQUENCY_DEFAULT_VALUE);
181-
if (ret) {
181+
if (ret < 0) {
182182
pr_err("Failed to add QoS request: %d\n", ret);
183183
goto out_dtpm_unregister;
184184
}

0 commit comments

Comments
 (0)