diff options
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 75c5bd424d59..37af929746af 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -985,8 +985,8 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, | |||
985 | struct cpufreq_policy *policy; | 985 | struct cpufreq_policy *policy; |
986 | unsigned long flags; | 986 | unsigned long flags; |
987 | #ifdef CONFIG_HOTPLUG_CPU | 987 | #ifdef CONFIG_HOTPLUG_CPU |
988 | struct cpufreq_policy *tpolicy; | ||
988 | struct cpufreq_governor *gov; | 989 | struct cpufreq_governor *gov; |
989 | int sibling; | ||
990 | #endif | 990 | #endif |
991 | 991 | ||
992 | if (cpu_is_offline(cpu)) | 992 | if (cpu_is_offline(cpu)) |
@@ -1006,11 +1006,11 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, | |||
1006 | #ifdef CONFIG_HOTPLUG_CPU | 1006 | #ifdef CONFIG_HOTPLUG_CPU |
1007 | /* Check if this cpu was hot-unplugged earlier and has siblings */ | 1007 | /* Check if this cpu was hot-unplugged earlier and has siblings */ |
1008 | read_lock_irqsave(&cpufreq_driver_lock, flags); | 1008 | read_lock_irqsave(&cpufreq_driver_lock, flags); |
1009 | for_each_online_cpu(sibling) { | 1009 | list_for_each_entry(tpolicy, &cpufreq_policy_list, policy_list) { |
1010 | struct cpufreq_policy *cp = per_cpu(cpufreq_cpu_data, sibling); | 1010 | if (cpumask_test_cpu(cpu, tpolicy->related_cpus)) { |
1011 | if (cp && cpumask_test_cpu(cpu, cp->related_cpus)) { | ||
1012 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); | 1011 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); |
1013 | return cpufreq_add_policy_cpu(cp, cpu, dev, frozen); | 1012 | return cpufreq_add_policy_cpu(tpolicy, cpu, dev, |
1013 | frozen); | ||
1014 | } | 1014 | } |
1015 | } | 1015 | } |
1016 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); | 1016 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); |