]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/fan.c
Merge branch 'linus' into release
[linux-2.6-omap-h63xx.git] / drivers / acpi / fan.c
index eaaee1660bdf41ec490696b812b2c17869daffe9..53698ea0837139996e6ae845168cc6e3b2337bdf 100644 (file)
@@ -68,31 +68,35 @@ static struct acpi_driver acpi_fan_driver = {
 };
 
 /* thermal cooling device callbacks */
-static int fan_get_max_state(struct thermal_cooling_device *cdev, char *buf)
+static int fan_get_max_state(struct thermal_cooling_device *cdev, unsigned long
+                            *state)
 {
        /* ACPI fan device only support two states: ON/OFF */
-       return sprintf(buf, "1\n");
+       *state = 1;
+       return 0;
 }
 
-static int fan_get_cur_state(struct thermal_cooling_device *cdev, char *buf)
+static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long
+                            *state)
 {
        struct acpi_device *device = cdev->devdata;
-       int state;
        int result;
+       int acpi_state;
 
        if (!device)
                return -EINVAL;
 
-       result = acpi_bus_get_power(device->handle, &state);
+       result = acpi_bus_get_power(device->handle, &acpi_state);
        if (result)
                return result;
 
-       return sprintf(buf, "%s\n", state == ACPI_STATE_D3 ? "0" :
-                        (state == ACPI_STATE_D0 ? "1" : "unknown"));
+       *state = (acpi_state == ACPI_STATE_D3 ? 0 :
+                (acpi_state == ACPI_STATE_D0 ? 1 : -1));
+       return 0;
 }
 
 static int
-fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned int state)
+fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state)
 {
        struct acpi_device *device = cdev->devdata;
        int result;
@@ -193,7 +197,6 @@ static int acpi_fan_add_fs(struct acpi_device *device)
                                                     acpi_fan_dir);
                if (!acpi_device_dir(device))
                        return -ENODEV;
-               acpi_device_dir(device)->owner = THIS_MODULE;
        }
 
        /* 'status' [R/W] */
@@ -347,7 +350,6 @@ static int __init acpi_fan_init(void)
        acpi_fan_dir = proc_mkdir(ACPI_FAN_CLASS, acpi_root_dir);
        if (!acpi_fan_dir)
                return -ENODEV;
-       acpi_fan_dir->owner = THIS_MODULE;
 #endif
 
        result = acpi_bus_register_driver(&acpi_fan_driver);