diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-12-04 09:41:56 +0530 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2015-06-05 15:42:17 -0700 |
commit | 64eb8eb27a1219607c3b3612ecfe567947f4b872 (patch) | |
tree | 9f0690812df01da9099afe56a01746193493da0d /drivers/thermal/cpu_cooling.c | |
parent | b3ee49fd5bf6cff7aef51981a4d394289c7495f2 (diff) |
thermal: cpu_cooling: don't iterate over all allowed_cpus to update cpufreq policy
All CPUs present in 'allowed_cpus' share the same 'struct cpufreq_policy'
structure and so calling cpufreq_update_policy() for each of them doesn't make
sense.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
(cherry picked from commit e1fae554fb69b8869acbea9397d15758a93d1204)
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'drivers/thermal/cpu_cooling.c')
-rw-r--r-- | drivers/thermal/cpu_cooling.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index f32573818db9..7f27f1b44776 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -285,11 +285,10 @@ static unsigned int get_cpu_frequency(unsigned int cpu, unsigned long level) static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device, unsigned long cooling_state) { - unsigned int cpuid, clip_freq; + unsigned int clip_freq; struct cpumask *mask = &cpufreq_device->allowed_cpus; unsigned int cpu = cpumask_any(mask); - /* Check if the old cooling action is same as new cooling action */ if (cpufreq_device->cpufreq_state == cooling_state) return 0; @@ -301,10 +300,8 @@ static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device, cpufreq_device->cpufreq_state = cooling_state; cpufreq_device->cpufreq_val = clip_freq; - for_each_cpu(cpuid, mask) { - if (is_cpufreq_valid(cpuid)) - cpufreq_update_policy(cpuid); - } + if (is_cpufreq_valid(cpu)) + cpufreq_update_policy(cpu); return 0; } |