aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/fan.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-04-05 01:39:12 -0400
committerLen Brown <len.brown@intel.com>2009-04-05 01:39:12 -0400
commit4f3bff70a64b105921dac8630bc4381567b21ebd (patch)
tree2601d581e21c4ca9392bbf85dfb981a2181ecba6 /drivers/acpi/fan.c
parent2ddb9f17ba026122b53b34fb4182ece91e24cf92 (diff)
parent03a971a2899886006f19f3495973bbd646d8bdae (diff)
Merge branch 'thermal' into release
Diffstat (limited to 'drivers/acpi/fan.c')
-rw-r--r--drivers/acpi/fan.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index eaaee1660bd..ae41cf3cf4e 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -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;