diff options
| -rw-r--r-- | drivers/acpi/bus.c | 3 | ||||
| -rw-r--r-- | drivers/acpi/internal.h | 2 | ||||
| -rw-r--r-- | drivers/acpi/power.c | 12 |
3 files changed, 7 insertions, 10 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index d68bd61072bb..a9fe8e6bc40e 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
| @@ -222,7 +222,8 @@ int acpi_bus_get_power(acpi_handle handle, int *state) | |||
| 222 | * indirectly (via power resources). | 222 | * indirectly (via power resources). |
| 223 | */ | 223 | */ |
| 224 | if (device->power.flags.power_resources) { | 224 | if (device->power.flags.power_resources) { |
| 225 | result = acpi_power_get_inferred_state(device); | 225 | result = acpi_power_get_inferred_state(device, |
| 226 | &device->power.state); | ||
| 226 | if (result) | 227 | if (result) |
| 227 | return result; | 228 | return result; |
| 228 | } else if (device->power.flags.explicit_get) { | 229 | } else if (device->power.flags.explicit_get) { |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index a212bfeddf8c..2cc01489dccf 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
| @@ -41,7 +41,7 @@ static inline int acpi_debugfs_init(void) { return 0; } | |||
| 41 | int acpi_power_init(void); | 41 | int acpi_power_init(void); |
| 42 | int acpi_device_sleep_wake(struct acpi_device *dev, | 42 | int acpi_device_sleep_wake(struct acpi_device *dev, |
| 43 | int enable, int sleep_state, int dev_state); | 43 | int enable, int sleep_state, int dev_state); |
| 44 | int acpi_power_get_inferred_state(struct acpi_device *device); | 44 | int acpi_power_get_inferred_state(struct acpi_device *device, int *state); |
| 45 | int acpi_power_transition(struct acpi_device *device, int state); | 45 | int acpi_power_transition(struct acpi_device *device, int state); |
| 46 | extern int acpi_power_nocheck; | 46 | extern int acpi_power_nocheck; |
| 47 | 47 | ||
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 4c9c2fb5d98f..9bd1b6044b55 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
| @@ -423,19 +423,16 @@ int acpi_disable_wakeup_device_power(struct acpi_device *dev) | |||
| 423 | Device Power Management | 423 | Device Power Management |
| 424 | -------------------------------------------------------------------------- */ | 424 | -------------------------------------------------------------------------- */ |
| 425 | 425 | ||
| 426 | int acpi_power_get_inferred_state(struct acpi_device *device) | 426 | int acpi_power_get_inferred_state(struct acpi_device *device, int *state) |
| 427 | { | 427 | { |
| 428 | int result = 0; | 428 | int result = 0; |
| 429 | struct acpi_handle_list *list = NULL; | 429 | struct acpi_handle_list *list = NULL; |
| 430 | int list_state = 0; | 430 | int list_state = 0; |
| 431 | int i = 0; | 431 | int i = 0; |
| 432 | 432 | ||
| 433 | 433 | if (!device || !state) | |
| 434 | if (!device) | ||
| 435 | return -EINVAL; | 434 | return -EINVAL; |
| 436 | 435 | ||
| 437 | device->power.state = ACPI_STATE_UNKNOWN; | ||
| 438 | |||
| 439 | /* | 436 | /* |
| 440 | * We know a device's inferred power state when all the resources | 437 | * We know a device's inferred power state when all the resources |
| 441 | * required for a given D-state are 'on'. | 438 | * required for a given D-state are 'on'. |
| @@ -450,13 +447,12 @@ int acpi_power_get_inferred_state(struct acpi_device *device) | |||
| 450 | return result; | 447 | return result; |
| 451 | 448 | ||
| 452 | if (list_state == ACPI_POWER_RESOURCE_STATE_ON) { | 449 | if (list_state == ACPI_POWER_RESOURCE_STATE_ON) { |
| 453 | device->power.state = i; | 450 | *state = i; |
| 454 | return 0; | 451 | return 0; |
| 455 | } | 452 | } |
| 456 | } | 453 | } |
| 457 | 454 | ||
| 458 | device->power.state = ACPI_STATE_D3; | 455 | *state = ACPI_STATE_D3; |
| 459 | |||
| 460 | return 0; | 456 | return 0; |
| 461 | } | 457 | } |
| 462 | 458 | ||
