libata-sff: port_task is SFF specific
[safe/jmp/linux-2.6] / drivers / acpi / processor_thermal.c
index 1f31699..6deafb4 100644 (file)
@@ -40,6 +40,8 @@
 #include <acpi/processor.h>
 #include <acpi/acpi_drivers.h>
 
+#define PREFIX "ACPI: "
+
 #define ACPI_PROCESSOR_CLASS            "processor"
 #define _COMPONENT              ACPI_PROCESSOR_COMPONENT
 ACPI_MODULE_NAME("processor_thermal");
@@ -66,7 +68,7 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr)
                if (pr->limit.thermal.tx > tx)
                        tx = pr->limit.thermal.tx;
 
-               result = acpi_processor_set_throttling(pr, tx);
+               result = acpi_processor_set_throttling(pr, tx, false);
                if (result)
                        goto end;
        }
@@ -373,7 +375,8 @@ static int acpi_processor_max_state(struct acpi_processor *pr)
        return max_state;
 }
 static int
-processor_get_max_state(struct thermal_cooling_device *cdev, char *buf)
+processor_get_max_state(struct thermal_cooling_device *cdev,
+                       unsigned long *state)
 {
        struct acpi_device *device = cdev->devdata;
        struct acpi_processor *pr = acpi_driver_data(device);
@@ -381,28 +384,29 @@ processor_get_max_state(struct thermal_cooling_device *cdev, char *buf)
        if (!device || !pr)
                return -EINVAL;
 
-       return sprintf(buf, "%d\n", acpi_processor_max_state(pr));
+       *state = acpi_processor_max_state(pr);
+       return 0;
 }
 
 static int
-processor_get_cur_state(struct thermal_cooling_device *cdev, char *buf)
+processor_get_cur_state(struct thermal_cooling_device *cdev,
+                       unsigned long *cur_state)
 {
        struct acpi_device *device = cdev->devdata;
        struct acpi_processor *pr = acpi_driver_data(device);
-       int cur_state;
 
        if (!device || !pr)
                return -EINVAL;
 
-       cur_state = cpufreq_get_cur_state(pr->id);
+       *cur_state = cpufreq_get_cur_state(pr->id);
        if (pr->flags.throttling)
-               cur_state += pr->throttling.state;
-
-       return sprintf(buf, "%d\n", cur_state);
+               *cur_state += pr->throttling.state;
+       return 0;
 }
 
 static int
-processor_set_cur_state(struct thermal_cooling_device *cdev, unsigned int state)
+processor_set_cur_state(struct thermal_cooling_device *cdev,
+                       unsigned long state)
 {
        struct acpi_device *device = cdev->devdata;
        struct acpi_processor *pr = acpi_driver_data(device);
@@ -419,12 +423,12 @@ processor_set_cur_state(struct thermal_cooling_device *cdev, unsigned int state)
 
        if (state <= max_pstate) {
                if (pr->flags.throttling && pr->throttling.state)
-                       result = acpi_processor_set_throttling(pr, 0);
+                       result = acpi_processor_set_throttling(pr, 0, false);
                cpufreq_set_cur_state(pr->id, state);
        } else {
                cpufreq_set_cur_state(pr->id, max_pstate);
                result = acpi_processor_set_throttling(pr,
-                               state - max_pstate);
+                               state - max_pstate, false);
        }
        return result;
 }
@@ -436,11 +440,10 @@ struct thermal_cooling_device_ops processor_cooling_ops = {
 };
 
 /* /proc interface */
-
+#ifdef CONFIG_ACPI_PROCFS
 static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset)
 {
-       struct acpi_processor *pr = (struct acpi_processor *)seq->private;
-
+       struct acpi_processor *pr = seq->private;
 
        if (!pr)
                goto end;
@@ -515,3 +518,4 @@ const struct file_operations acpi_processor_limit_fops = {
        .llseek = seq_lseek,
        .release = single_release,
 };
+#endif