]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / cpu / cpufreq / speedstep-ich.c
index 36685e8f7be1171cf260d75646be0dff7f00a472..2f3728dc24f60cc41db81e0066927a4ff15f409f 100644 (file)
@@ -229,22 +229,23 @@ static unsigned int speedstep_detect_chipset (void)
        return 0;
 }
 
-static unsigned int _speedstep_get(cpumask_t cpus)
+static unsigned int _speedstep_get(const cpumask_t *cpus)
 {
        unsigned int speed;
        cpumask_t cpus_allowed;
 
        cpus_allowed = current->cpus_allowed;
-       set_cpus_allowed(current, cpus);
+       set_cpus_allowed_ptr(current, cpus);
        speed = speedstep_get_processor_frequency(speedstep_processor);
-       set_cpus_allowed(current, cpus_allowed);
+       set_cpus_allowed_ptr(current, &cpus_allowed);
        dprintk("detected %u kHz as current frequency\n", speed);
        return speed;
 }
 
 static unsigned int speedstep_get(unsigned int cpu)
 {
-       return _speedstep_get(cpumask_of_cpu(cpu));
+       cpumask_of_cpu_ptr(newmask, cpu);
+       return _speedstep_get(newmask);
 }
 
 /**
@@ -267,7 +268,7 @@ static int speedstep_target (struct cpufreq_policy *policy,
        if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))
                return -EINVAL;
 
-       freqs.old = _speedstep_get(policy->cpus);
+       freqs.old = _speedstep_get(&policy->cpus);
        freqs.new = speedstep_freqs[newstate].frequency;
        freqs.cpu = policy->cpu;
 
@@ -279,20 +280,20 @@ static int speedstep_target (struct cpufreq_policy *policy,
 
        cpus_allowed = current->cpus_allowed;
 
-       for_each_cpu_mask(i, policy->cpus) {
+       for_each_cpu_mask_nr(i, policy->cpus) {
                freqs.cpu = i;
                cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
        }
 
        /* switch to physical CPU where state is to be changed */
-       set_cpus_allowed(current, policy->cpus);
+       set_cpus_allowed_ptr(current, &policy->cpus);
 
        speedstep_set_state(newstate);
 
        /* allow to be run on all CPUs */
-       set_cpus_allowed(current, cpus_allowed);
+       set_cpus_allowed_ptr(current, &cpus_allowed);
 
-       for_each_cpu_mask(i, policy->cpus) {
+       for_each_cpu_mask_nr(i, policy->cpus) {
                freqs.cpu = i;
                cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        }
@@ -322,11 +323,11 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
 
        /* only run on CPU to be set, or on its sibling */
 #ifdef CONFIG_SMP
-       policy->cpus = cpu_sibling_map[policy->cpu];
+       policy->cpus = per_cpu(cpu_sibling_map, policy->cpu);
 #endif
 
        cpus_allowed = current->cpus_allowed;
-       set_cpus_allowed(current, policy->cpus);
+       set_cpus_allowed_ptr(current, &policy->cpus);
 
        /* detect low and high frequency and transition latency */
        result = speedstep_get_freqs(speedstep_processor,
@@ -334,12 +335,12 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
                                     &speedstep_freqs[SPEEDSTEP_HIGH].frequency,
                                     &policy->cpuinfo.transition_latency,
                                     &speedstep_set_state);
-       set_cpus_allowed(current, cpus_allowed);
+       set_cpus_allowed_ptr(current, &cpus_allowed);
        if (result)
                return result;
 
        /* get current speed setting */
-       speed = _speedstep_get(policy->cpus);
+       speed = _speedstep_get(&policy->cpus);
        if (!speed)
                return -EIO;