fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / ia64 / kernel / cpufreq / acpi-cpufreq.c
index 5a1bf81..15c08d5 100644 (file)
@@ -9,7 +9,6 @@
  *      Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -69,7 +68,8 @@ processor_get_pstate (
 
        dprintk("processor_get_pstate\n");
 
-       retval = ia64_pal_get_pstate(&pstate_index);
+       retval = ia64_pal_get_pstate(&pstate_index,
+                                    PAL_GET_PSTATE_TYPE_INSTANT);
        *value = (u32) pstate_index;
 
        if (retval)
@@ -92,7 +92,7 @@ extract_clock (
        dprintk("extract_clock\n");
 
        for (i = 0; i < data->acpi_data.state_count; i++) {
-               if (value >= data->acpi_data.states[i].control)
+               if (value == data->acpi_data.states[i].status)
                        return data->acpi_data.states[i].core_frequency;
        }
        return data->acpi_data.states[i-1].core_frequency;
@@ -118,11 +118,7 @@ processor_get_freq (
                goto migrate_end;
        }
 
-       /*
-        * processor_get_pstate gets the average frequency since the
-        * last get. So, do two PAL_get_freq()...
-        */
-       ret = processor_get_pstate(&value);
+       /* processor_get_pstate gets the instantaneous frequency */
        ret = processor_get_pstate(&value);
 
        if (ret) {
@@ -280,12 +276,10 @@ acpi_cpufreq_cpu_init (
 
        dprintk("acpi_cpufreq_cpu_init\n");
 
-       data = kmalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
+       data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
        if (!data)
                return (-ENOMEM);
 
-       memset(data, 0, sizeof(struct cpufreq_acpi_io));
-
        acpi_io_data[cpu] = data;
 
        result = acpi_processor_register_performance(&data->acpi_data, cpu);