[PATCH] remove for_each_cpu()
[linux-2.6.git] / arch / i386 / kernel / cpu / cpufreq / acpi-cpufreq.c
index 4c7c6e0..5fd6532 100644 (file)
@@ -174,7 +174,6 @@ acpi_processor_set_performance (
                        udelay(10);
                }
        } else {
-               i = 0;
                value = (u32) perf->states[state].status;
        }
 
@@ -225,8 +224,12 @@ acpi_cpufreq_target (
        freqs.old = data->freq_table[cur_state].frequency;
        freqs.new = data->freq_table[next_state].frequency;
 
+#ifdef CONFIG_HOTPLUG_CPU
        /* cpufreq holds the hotplug lock, so we are safe from here on */
        cpus_and(online_policy_cpus, cpu_online_map, policy->cpus);
+#else
+       online_policy_cpus = policy->cpus;
+#endif
 
        for_each_cpu_mask(j, online_policy_cpus) {
                freqs.cpu = j;
@@ -368,11 +371,11 @@ static int acpi_cpufreq_early_init_acpi(void)
 
        dprintk("acpi_cpufreq_early_init\n");
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                data = kzalloc(sizeof(struct acpi_processor_performance), 
                        GFP_KERNEL);
                if (!data) {
-                       for_each_cpu(j) {
+                       for_each_possible_cpu(j) {
                                kfree(acpi_perf_data[j]);
                                acpi_perf_data[j] = NULL;
                        }
@@ -545,14 +548,15 @@ static struct freq_attr* acpi_cpufreq_attr[] = {
 };
 
 static struct cpufreq_driver acpi_cpufreq_driver = {
-       .verify         = acpi_cpufreq_verify,
-       .target         = acpi_cpufreq_target,
-       .init           = acpi_cpufreq_cpu_init,
-       .exit           = acpi_cpufreq_cpu_exit,
-       .resume         = acpi_cpufreq_resume,
-       .name           = "acpi-cpufreq",
-       .owner          = THIS_MODULE,
-       .attr           = acpi_cpufreq_attr,
+       .verify = acpi_cpufreq_verify,
+       .target = acpi_cpufreq_target,
+       .init   = acpi_cpufreq_cpu_init,
+       .exit   = acpi_cpufreq_cpu_exit,
+       .resume = acpi_cpufreq_resume,
+       .name   = "acpi-cpufreq",
+       .owner  = THIS_MODULE,
+       .attr   = acpi_cpufreq_attr,
+       .flags  = CPUFREQ_STICKY,
 };
 
 
@@ -580,7 +584,7 @@ acpi_cpufreq_exit (void)
 
        cpufreq_unregister_driver(&acpi_cpufreq_driver);
 
-       for_each_cpu(i) {
+       for_each_possible_cpu(i) {
                kfree(acpi_perf_data[i]);
                acpi_perf_data[i] = NULL;
        }