]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
Merge branch 'linus' into test
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / cpu / cpufreq / acpi-cpufreq.c
index 9943b4c8774609e2af1ff4f4b9e8374e22a8937b..8e48c5d4467df61d3652a39b06b85e7389143c54 100644 (file)
@@ -256,7 +256,8 @@ static u32 get_cur_val(const cpumask_t *mask)
  * Only IA32_APERF/IA32_MPERF ratio is architecturally defined and
  * no meaning should be associated with absolute values of these MSRs.
  */
-static unsigned int get_measured_perf(unsigned int cpu)
+static unsigned int get_measured_perf(struct cpufreq_policy *policy,
+                                     unsigned int cpu)
 {
        union {
                struct {
@@ -326,7 +327,7 @@ static unsigned int get_measured_perf(unsigned int cpu)
 
 #endif
 
-       retval = per_cpu(drv_data, cpu)->max_freq * perf_percent / 100;
+       retval = per_cpu(drv_data, policy->cpu)->max_freq * perf_percent / 100;
 
        put_cpu();
        set_cpus_allowed_ptr(current, &saved_mask);
@@ -788,7 +789,11 @@ static int __init acpi_cpufreq_init(void)
        if (ret)
                return ret;
 
-       return cpufreq_register_driver(&acpi_cpufreq_driver);
+       ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+       if (ret)
+               free_percpu(acpi_perf_data);
+
+       return ret;
 }
 
 static void __exit acpi_cpufreq_exit(void)
@@ -798,8 +803,6 @@ static void __exit acpi_cpufreq_exit(void)
        cpufreq_unregister_driver(&acpi_cpufreq_driver);
 
        free_percpu(acpi_perf_data);
-
-       return;
 }
 
 module_param(acpi_pstate_strict, uint, 0644);