Skip to content

Commit b50155c

Browse files
dlezcanorafaeljw
authored andcommitted
powercap: dtpm_cpu: Fix error check against freq_qos_add_request()
The caller of the function freq_qos_add_request() checks again a non zero value but freq_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: 0e8f68d ("Add CPU energy model based support") Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 4add6e8 commit b50155c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/powercap/dtpm_cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
219219
ret = freq_qos_add_request(&policy->constraints,
220220
&dtpm_cpu->qos_req, FREQ_QOS_MAX,
221221
pd->table[pd->nr_perf_states - 1].frequency);
222-
if (ret)
222+
if (ret < 0)
223223
goto out_dtpm_unregister;
224224

225225
cpufreq_cpu_put(policy);

0 commit comments

Comments
 (0)