aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2007-10-22 06:19:21 -0400
committerLen Brown <len.brown@intel.com>2007-10-25 16:31:31 -0400
commit93ad7c07ad487b036add8760dabcc35666a550ef (patch)
tree60538ab8a4eb901f94142a6a02a3ccf89b46895d /drivers
parent968fc5dc2699434ea1cbddaf189f19c4eb4dbe55 (diff)
ACPI: Fan: Drop force_power_state acpi_device option
force_power_state was used as a workaround for invalid cached power state of the device. We do not cache power state, so no need for workaround. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/bus.c2
-rw-r--r--drivers/acpi/fan.c40
2 files changed, 1 insertions, 41 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index fdee82d37b7d..49d432d0a12c 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -201,7 +201,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
201 * Get device's current power state 201 * Get device's current power state
202 */ 202 */
203 acpi_bus_get_power(device->handle, &device->power.state); 203 acpi_bus_get_power(device->handle, &device->power.state);
204 if ((state == device->power.state) && !device->flags.force_power_state) { 204 if (state == device->power.state) {
205 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", 205 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
206 state)); 206 state));
207 return 0; 207 return 0;
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index a6e149d692cb..a5a5532db268 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -47,8 +47,6 @@ MODULE_LICENSE("GPL");
47 47
48static int acpi_fan_add(struct acpi_device *device); 48static int acpi_fan_add(struct acpi_device *device);
49static int acpi_fan_remove(struct acpi_device *device, int type); 49static int acpi_fan_remove(struct acpi_device *device, int type);
50static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
51static int acpi_fan_resume(struct acpi_device *device);
52 50
53static const struct acpi_device_id fan_device_ids[] = { 51static const struct acpi_device_id fan_device_ids[] = {
54 {"PNP0C0B", 0}, 52 {"PNP0C0B", 0},
@@ -63,8 +61,6 @@ static struct acpi_driver acpi_fan_driver = {
63 .ops = { 61 .ops = {
64 .add = acpi_fan_add, 62 .add = acpi_fan_add,
65 .remove = acpi_fan_remove, 63 .remove = acpi_fan_remove,
66 .suspend = acpi_fan_suspend,
67 .resume = acpi_fan_resume,
68 }, 64 },
69}; 65};
70 66
@@ -195,10 +191,6 @@ static int acpi_fan_add(struct acpi_device *device)
195 goto end; 191 goto end;
196 } 192 }
197 193
198 device->flags.force_power_state = 1;
199 acpi_bus_set_power(device->handle, state);
200 device->flags.force_power_state = 0;
201
202 result = acpi_fan_add_fs(device); 194 result = acpi_fan_add_fs(device);
203 if (result) 195 if (result)
204 goto end; 196 goto end;
@@ -224,38 +216,6 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
224 return 0; 216 return 0;
225} 217}
226 218
227static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state)
228{
229 if (!device)
230 return -EINVAL;
231
232 acpi_bus_set_power(device->handle, ACPI_STATE_D0);
233
234 return AE_OK;
235}
236
237static int acpi_fan_resume(struct acpi_device *device)
238{
239 int result = 0;
240 int power_state = 0;
241
242 if (!device)
243 return -EINVAL;
244
245 result = acpi_bus_get_power(device->handle, &power_state);
246 if (result) {
247 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
248 "Error reading fan power state\n"));
249 return result;
250 }
251
252 device->flags.force_power_state = 1;
253 acpi_bus_set_power(device->handle, power_state);
254 device->flags.force_power_state = 0;
255
256 return result;
257}
258
259static int __init acpi_fan_init(void) 219static int __init acpi_fan_init(void)
260{ 220{
261 int result = 0; 221 int result = 0;