Pull thermal into release branch
[sfrench/cifs-2.6.git] / arch / powerpc / platforms / powermac / cpufreq_64.c
index d30466d741942c621db357a0fc1aa18c3be21a2e..00f50298c342aad55c982687e03bddbde0d731cb 100644 (file)
@@ -104,7 +104,7 @@ static void g5_smu_switch_volt(int speed_mode)
 {
        struct smu_simple_cmd   cmd;
 
-       DECLARE_COMPLETION(comp);
+       DECLARE_COMPLETION_ONSTACK(comp);
        smu_queue_simple(&cmd, SMU_CMD_POWER_COMMAND, 8, smu_done_complete,
                         &comp, 'V', 'S', 'L', 'E', 'W',
                         0xff, g5_fvt_cur+1, speed_mode);
@@ -357,13 +357,13 @@ static unsigned int g5_cpufreq_get_speed(unsigned int cpu)
 
 static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
-       if (policy->cpu != 0)
-               return -ENODEV;
-
        policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
        policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
        policy->cur = g5_cpu_freqs[g5_query_freq()].frequency;
-       policy->cpus = cpu_possible_map;
+       /* secondary CPUs are tied to the primary one by the
+        * cpufreq core if in the secondary policy we tell it that
+        * it actually must be one policy together with all others. */
+       policy->cpus = cpu_online_map;
        cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu);
 
        return cpufreq_frequency_table_cpuinfo(policy,
@@ -410,7 +410,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
        /* Get first CPU node */
        for (cpunode = NULL;
             (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) {
-               const u32 *reg = get_property(cpunode, "reg", NULL);
+               const u32 *reg = of_get_property(cpunode, "reg", NULL);
                if (reg == NULL || (*reg) != 0)
                        continue;
                if (!strcmp(cpunode->type, "cpu"))
@@ -422,7 +422,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
        }
 
        /* Check 970FX for now */
-       valp = get_property(cpunode, "cpu-version", NULL);
+       valp = of_get_property(cpunode, "cpu-version", NULL);
        if (!valp) {
                DBG("No cpu-version property !\n");
                goto bail_noprops;
@@ -434,7 +434,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
        }
 
        /* Look for the powertune data in the device-tree */
-       g5_pmode_data = get_property(cpunode, "power-mode-data",&psize);
+       g5_pmode_data = of_get_property(cpunode, "power-mode-data",&psize);
        if (!g5_pmode_data) {
                DBG("No power-mode-data !\n");
                goto bail_noprops;
@@ -493,7 +493,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
         * half freq in this version. So far, I haven't yet seen a machine
         * supporting anything else.
         */
-       valp = get_property(cpunode, "clock-frequency", NULL);
+       valp = of_get_property(cpunode, "clock-frequency", NULL);
        if (!valp)
                return -ENODEV;
        max_freq = (*valp)/1000;
@@ -563,7 +563,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
        /* Lookup the cpuid eeprom node */
         cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0");
        if (cpuid != NULL)
-               eeprom = get_property(cpuid, "cpuid", NULL);
+               eeprom = of_get_property(cpuid, "cpuid", NULL);
        if (eeprom == NULL) {
                printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n");
                rc = -ENODEV;
@@ -573,13 +573,13 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
        /* Lookup the i2c hwclock */
        for (hwclock = NULL;
             (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){
-               const char *loc = get_property(hwclock,
+               const char *loc = of_get_property(hwclock,
                                "hwctrl-location", NULL);
                if (loc == NULL)
                        continue;
                if (strcmp(loc, "CPU CLOCK"))
                        continue;
-               if (!get_property(hwclock, "platform-get-frequency", NULL))
+               if (!of_get_property(hwclock, "platform-get-frequency", NULL))
                        continue;
                break;
        }
@@ -638,7 +638,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
         */
 
        /* Get max frequency from device-tree */
-       valp = get_property(cpunode, "clock-frequency", NULL);
+       valp = of_get_property(cpunode, "clock-frequency", NULL);
        if (!valp) {
                printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n");
                rc = -ENODEV;