diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-05 14:16:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-05 14:16:25 -0400 |
commit | 32fb6c17566ec66de87324a834c7776f40e35e78 (patch) | |
tree | 87b8ed5d66495536fbb452255c3eacd1cfb0c43a /drivers/acpi/fan.c | |
parent | 45e36c1666aa6c8b0c538abcf984b336184d8c3f (diff) | |
parent | 7ec0a7290797f57b780f792d12f4bcc19c83aa4f (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (140 commits)
ACPI: processor: use .notify method instead of installing handler directly
ACPI: button: use .notify method instead of installing handler directly
ACPI: support acpi_device_ops .notify methods
toshiba-acpi: remove MAINTAINERS entry
ACPI: battery: asynchronous init
acer-wmi: Update copyright notice & documentation
acer-wmi: Cleanup the failure cleanup handling
acer-wmi: Blacklist Acer Aspire One
video: build fix
thinkpad-acpi: rework brightness support
thinkpad-acpi: enhanced debugging messages for the fan subdriver
thinkpad-acpi: enhanced debugging messages for the hotkey subdriver
thinkpad-acpi: enhanced debugging messages for rfkill subdrivers
thinkpad-acpi: restrict access to some firmware LEDs
thinkpad-acpi: remove HKEY disable functionality
thinkpad-acpi: add new debug helpers and warn of deprecated atts
thinkpad-acpi: add missing log levels
thinkpad-acpi: cleanup debug helpers
thinkpad-acpi: documentation cleanup
thinkpad-acpi: drop ibm-acpi alias
...
Diffstat (limited to 'drivers/acpi/fan.c')
-rw-r--r-- | drivers/acpi/fan.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 8a02944bf92d..53698ea08371 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
@@ -68,31 +68,35 @@ static struct acpi_driver acpi_fan_driver = { | |||
68 | }; | 68 | }; |
69 | 69 | ||
70 | /* thermal cooling device callbacks */ | 70 | /* thermal cooling device callbacks */ |
71 | static int fan_get_max_state(struct thermal_cooling_device *cdev, char *buf) | 71 | static int fan_get_max_state(struct thermal_cooling_device *cdev, unsigned long |
72 | *state) | ||
72 | { | 73 | { |
73 | /* ACPI fan device only support two states: ON/OFF */ | 74 | /* ACPI fan device only support two states: ON/OFF */ |
74 | return sprintf(buf, "1\n"); | 75 | *state = 1; |
76 | return 0; | ||
75 | } | 77 | } |
76 | 78 | ||
77 | static int fan_get_cur_state(struct thermal_cooling_device *cdev, char *buf) | 79 | static int fan_get_cur_state(struct thermal_cooling_device *cdev, unsigned long |
80 | *state) | ||
78 | { | 81 | { |
79 | struct acpi_device *device = cdev->devdata; | 82 | struct acpi_device *device = cdev->devdata; |
80 | int state; | ||
81 | int result; | 83 | int result; |
84 | int acpi_state; | ||
82 | 85 | ||
83 | if (!device) | 86 | if (!device) |
84 | return -EINVAL; | 87 | return -EINVAL; |
85 | 88 | ||
86 | result = acpi_bus_get_power(device->handle, &state); | 89 | result = acpi_bus_get_power(device->handle, &acpi_state); |
87 | if (result) | 90 | if (result) |
88 | return result; | 91 | return result; |
89 | 92 | ||
90 | return sprintf(buf, "%s\n", state == ACPI_STATE_D3 ? "0" : | 93 | *state = (acpi_state == ACPI_STATE_D3 ? 0 : |
91 | (state == ACPI_STATE_D0 ? "1" : "unknown")); | 94 | (acpi_state == ACPI_STATE_D0 ? 1 : -1)); |
95 | return 0; | ||
92 | } | 96 | } |
93 | 97 | ||
94 | static int | 98 | static int |
95 | fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned int state) | 99 | fan_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) |
96 | { | 100 | { |
97 | struct acpi_device *device = cdev->devdata; | 101 | struct acpi_device *device = cdev->devdata; |
98 | int result; | 102 | int result; |