diff options
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0586bd20a474..81ceea6ed630 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -961,8 +961,8 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, | |||
961 | struct cpufreq_policy *policy; | 961 | struct cpufreq_policy *policy; |
962 | unsigned long flags; | 962 | unsigned long flags; |
963 | #ifdef CONFIG_HOTPLUG_CPU | 963 | #ifdef CONFIG_HOTPLUG_CPU |
964 | struct cpufreq_policy *tpolicy; | ||
964 | struct cpufreq_governor *gov; | 965 | struct cpufreq_governor *gov; |
965 | int sibling; | ||
966 | #endif | 966 | #endif |
967 | 967 | ||
968 | if (cpu_is_offline(cpu)) | 968 | if (cpu_is_offline(cpu)) |
@@ -985,11 +985,10 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, | |||
985 | #ifdef CONFIG_HOTPLUG_CPU | 985 | #ifdef CONFIG_HOTPLUG_CPU |
986 | /* Check if this cpu was hot-unplugged earlier and has siblings */ | 986 | /* Check if this cpu was hot-unplugged earlier and has siblings */ |
987 | read_lock_irqsave(&cpufreq_driver_lock, flags); | 987 | read_lock_irqsave(&cpufreq_driver_lock, flags); |
988 | for_each_online_cpu(sibling) { | 988 | list_for_each_entry(tpolicy, &cpufreq_policy_list, policy_list) { |
989 | struct cpufreq_policy *cp = per_cpu(cpufreq_cpu_data, sibling); | 989 | if (cpumask_test_cpu(cpu, tpolicy->related_cpus)) { |
990 | if (cp && cpumask_test_cpu(cpu, cp->related_cpus)) { | ||
991 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); | 990 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); |
992 | ret = cpufreq_add_policy_cpu(cp, cpu, dev, frozen); | 991 | ret = cpufreq_add_policy_cpu(tpolicy, cpu, dev, frozen); |
993 | up_read(&cpufreq_rwsem); | 992 | up_read(&cpufreq_rwsem); |
994 | return ret; | 993 | return ret; |
995 | } | 994 | } |