diff options
-rw-r--r-- | drivers/acpi/bus.c | 15 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 1 |
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 8e57fc49726e..0e1441cc4d7f 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -200,7 +200,16 @@ static const char *state_string(int state) | |||
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | static int __acpi_bus_get_power(struct acpi_device *device, int *state) | 203 | /** |
204 | * acpi_device_get_power - Get power state of an ACPI device. | ||
205 | * @device: Device to get the power state of. | ||
206 | * @state: Place to store the power state of the device. | ||
207 | * | ||
208 | * This function does not update the device's power.state field, but it may | ||
209 | * update its parent's power.state field (when the parent's power state is | ||
210 | * unknown and the device's power state turns out to be D0). | ||
211 | */ | ||
212 | int acpi_device_get_power(struct acpi_device *device, int *state) | ||
204 | { | 213 | { |
205 | int result = ACPI_STATE_UNKNOWN; | 214 | int result = ACPI_STATE_UNKNOWN; |
206 | 215 | ||
@@ -397,7 +406,7 @@ int acpi_bus_init_power(struct acpi_device *device) | |||
397 | 406 | ||
398 | device->power.state = ACPI_STATE_UNKNOWN; | 407 | device->power.state = ACPI_STATE_UNKNOWN; |
399 | 408 | ||
400 | result = __acpi_bus_get_power(device, &state); | 409 | result = acpi_device_get_power(device, &state); |
401 | if (result) | 410 | if (result) |
402 | return result; | 411 | return result; |
403 | 412 | ||
@@ -421,7 +430,7 @@ int acpi_bus_update_power(acpi_handle handle, int *state_p) | |||
421 | if (result) | 430 | if (result) |
422 | return result; | 431 | return result; |
423 | 432 | ||
424 | result = __acpi_bus_get_power(device, &state); | 433 | result = acpi_device_get_power(device, &state); |
425 | if (result) | 434 | if (result) |
426 | return result; | 435 | return result; |
427 | 436 | ||
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index a272c3156999..9d7c2ca0f1f7 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -331,6 +331,7 @@ acpi_status acpi_bus_get_status_handle(acpi_handle handle, | |||
331 | unsigned long long *sta); | 331 | unsigned long long *sta); |
332 | int acpi_bus_get_status(struct acpi_device *device); | 332 | int acpi_bus_get_status(struct acpi_device *device); |
333 | int acpi_bus_set_power(acpi_handle handle, int state); | 333 | int acpi_bus_set_power(acpi_handle handle, int state); |
334 | int acpi_device_get_power(struct acpi_device *device, int *state); | ||
334 | int acpi_device_set_power(struct acpi_device *device, int state); | 335 | int acpi_device_set_power(struct acpi_device *device, int state); |
335 | int acpi_bus_update_power(acpi_handle handle, int *state_p); | 336 | int acpi_bus_update_power(acpi_handle handle, int *state_p); |
336 | bool acpi_bus_power_manageable(acpi_handle handle); | 337 | bool acpi_bus_power_manageable(acpi_handle handle); |