aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/thermal/cpu_cooling.c9
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)
285static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device, 285static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device,
286 unsigned long cooling_state) 286 unsigned long cooling_state)
287{ 287{
288 unsigned int cpuid, clip_freq; 288 unsigned int clip_freq;
289 struct cpumask *mask = &cpufreq_device->allowed_cpus; 289 struct cpumask *mask = &cpufreq_device->allowed_cpus;
290 unsigned int cpu = cpumask_any(mask); 290 unsigned int cpu = cpumask_any(mask);
291 291
292
293 /* Check if the old cooling action is same as new cooling action */ 292 /* Check if the old cooling action is same as new cooling action */
294 if (cpufreq_device->cpufreq_state == cooling_state) 293 if (cpufreq_device->cpufreq_state == cooling_state)
295 return 0; 294 return 0;
@@ -301,10 +300,8 @@ static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device,
301 cpufreq_device->cpufreq_state = cooling_state; 300 cpufreq_device->cpufreq_state = cooling_state;
302 cpufreq_device->cpufreq_val = clip_freq; 301 cpufreq_device->cpufreq_val = clip_freq;
303 302
304 for_each_cpu(cpuid, mask) { 303 if (is_cpufreq_valid(cpu))
305 if (is_cpufreq_valid(cpuid)) 304 cpufreq_update_policy(cpu);
306 cpufreq_update_policy(cpuid);
307 }
308 305
309 return 0; 306 return 0;
310} 307}