diff options
-rw-r--r-- | drivers/acpi/device_pm.c | 15 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 16 |
2 files changed, 9 insertions, 22 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 318fa32a141e..26d3fd718a04 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
@@ -399,7 +399,7 @@ bool acpi_bus_can_wakeup(acpi_handle handle) | |||
399 | EXPORT_SYMBOL(acpi_bus_can_wakeup); | 399 | EXPORT_SYMBOL(acpi_bus_can_wakeup); |
400 | 400 | ||
401 | /** | 401 | /** |
402 | * acpi_device_power_state - Get preferred power state of ACPI device. | 402 | * acpi_dev_pm_get_state - Get preferred power state of ACPI device. |
403 | * @dev: Device whose preferred target power state to return. | 403 | * @dev: Device whose preferred target power state to return. |
404 | * @adev: ACPI device node corresponding to @dev. | 404 | * @adev: ACPI device node corresponding to @dev. |
405 | * @target_state: System state to match the resultant device state. | 405 | * @target_state: System state to match the resultant device state. |
@@ -417,8 +417,8 @@ EXPORT_SYMBOL(acpi_bus_can_wakeup); | |||
417 | * Callers must ensure that @dev and @adev are valid pointers and that @adev | 417 | * Callers must ensure that @dev and @adev are valid pointers and that @adev |
418 | * actually corresponds to @dev before using this function. | 418 | * actually corresponds to @dev before using this function. |
419 | */ | 419 | */ |
420 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, | 420 | static int acpi_dev_pm_get_state(struct device *dev, struct acpi_device *adev, |
421 | u32 target_state, int d_max_in, int *d_min_p) | 421 | u32 target_state, int d_max_in, int *d_min_p) |
422 | { | 422 | { |
423 | char acpi_method[] = "_SxD"; | 423 | char acpi_method[] = "_SxD"; |
424 | unsigned long long d_min, d_max; | 424 | unsigned long long d_min, d_max; |
@@ -501,7 +501,6 @@ int acpi_device_power_state(struct device *dev, struct acpi_device *adev, | |||
501 | } | 501 | } |
502 | return d_max; | 502 | return d_max; |
503 | } | 503 | } |
504 | EXPORT_SYMBOL_GPL(acpi_device_power_state); | ||
505 | 504 | ||
506 | /** | 505 | /** |
507 | * acpi_pm_device_sleep_state - Get preferred power state of ACPI device. | 506 | * acpi_pm_device_sleep_state - Get preferred power state of ACPI device. |
@@ -523,8 +522,8 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in) | |||
523 | return -ENODEV; | 522 | return -ENODEV; |
524 | } | 523 | } |
525 | 524 | ||
526 | return acpi_device_power_state(dev, adev, acpi_target_system_state(), | 525 | return acpi_dev_pm_get_state(dev, adev, acpi_target_system_state(), |
527 | d_max_in, d_min_p); | 526 | d_max_in, d_min_p); |
528 | } | 527 | } |
529 | EXPORT_SYMBOL(acpi_pm_device_sleep_state); | 528 | EXPORT_SYMBOL(acpi_pm_device_sleep_state); |
530 | 529 | ||
@@ -680,8 +679,8 @@ static int acpi_dev_pm_low_power(struct device *dev, struct acpi_device *adev, | |||
680 | if (!acpi_device_power_manageable(adev)) | 679 | if (!acpi_device_power_manageable(adev)) |
681 | return 0; | 680 | return 0; |
682 | 681 | ||
683 | power_state = acpi_device_power_state(dev, adev, system_state, | 682 | power_state = acpi_dev_pm_get_state(dev, adev, system_state, |
684 | ACPI_STATE_D3, NULL); | 683 | ACPI_STATE_D3, NULL); |
685 | if (power_state < ACPI_STATE_D0 || power_state > ACPI_STATE_D3) | 684 | if (power_state < ACPI_STATE_D0 || power_state > ACPI_STATE_D3) |
686 | return -EIO; | 685 | return -EIO; |
687 | 686 | ||
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 636c59f2003a..c3dc203a90f4 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -467,8 +467,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | |||
467 | acpi_notify_handler handler, void *context); | 467 | acpi_notify_handler handler, void *context); |
468 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | 468 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, |
469 | acpi_notify_handler handler); | 469 | acpi_notify_handler handler); |
470 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, | ||
471 | u32 target_state, int d_max_in, int *d_min_p); | ||
472 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 470 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
473 | void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); | 471 | void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); |
474 | void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); | 472 | void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); |
@@ -484,23 +482,13 @@ static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | |||
484 | { | 482 | { |
485 | return AE_SUPPORT; | 483 | return AE_SUPPORT; |
486 | } | 484 | } |
487 | static inline int __acpi_device_power_state(int m, int *p) | 485 | static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) |
488 | { | 486 | { |
489 | if (p) | 487 | if (p) |
490 | *p = ACPI_STATE_D0; | 488 | *p = ACPI_STATE_D0; |
489 | |||
491 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; | 490 | return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; |
492 | } | 491 | } |
493 | static inline int acpi_device_power_state(struct device *dev, | ||
494 | struct acpi_device *adev, | ||
495 | u32 target_state, int d_max_in, | ||
496 | int *d_min_p) | ||
497 | { | ||
498 | return __acpi_device_power_state(d_max_in, d_min_p); | ||
499 | } | ||
500 | static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | ||
501 | { | ||
502 | return __acpi_device_power_state(m, p); | ||
503 | } | ||
504 | static inline void acpi_dev_pm_add_dependent(acpi_handle handle, | 492 | static inline void acpi_dev_pm_add_dependent(acpi_handle handle, |
505 | struct device *depdev) {} | 493 | struct device *depdev) {} |
506 | static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, | 494 | static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, |