aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/device_pm.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index b3480cf7db1a..c14aa9a8a1b9 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -713,18 +713,6 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
713#endif /* CONFIG_PM_SLEEP */ 713#endif /* CONFIG_PM_SLEEP */
714 714
715/** 715/**
716 * acpi_dev_pm_get_node - Get ACPI device node for the given physical device.
717 * @dev: Device to get the ACPI node for.
718 */
719struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
720{
721 acpi_handle handle = ACPI_HANDLE(dev);
722 struct acpi_device *adev;
723
724 return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
725}
726
727/**
728 * acpi_dev_pm_low_power - Put ACPI device into a low-power state. 716 * acpi_dev_pm_low_power - Put ACPI device into a low-power state.
729 * @dev: Device to put into a low-power state. 717 * @dev: Device to put into a low-power state.
730 * @adev: ACPI device node corresponding to @dev. 718 * @adev: ACPI device node corresponding to @dev.
@@ -764,7 +752,7 @@ static int acpi_dev_pm_full_power(struct acpi_device *adev)
764 */ 752 */
765int acpi_dev_runtime_suspend(struct device *dev) 753int acpi_dev_runtime_suspend(struct device *dev)
766{ 754{
767 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 755 struct acpi_device *adev = ACPI_COMPANION(dev);
768 bool remote_wakeup; 756 bool remote_wakeup;
769 int error; 757 int error;
770 758
@@ -795,7 +783,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_runtime_suspend);
795 */ 783 */
796int acpi_dev_runtime_resume(struct device *dev) 784int acpi_dev_runtime_resume(struct device *dev)
797{ 785{
798 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 786 struct acpi_device *adev = ACPI_COMPANION(dev);
799 int error; 787 int error;
800 788
801 if (!adev) 789 if (!adev)
@@ -848,7 +836,7 @@ EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume);
848 */ 836 */
849int acpi_dev_suspend_late(struct device *dev) 837int acpi_dev_suspend_late(struct device *dev)
850{ 838{
851 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 839 struct acpi_device *adev = ACPI_COMPANION(dev);
852 u32 target_state; 840 u32 target_state;
853 bool wakeup; 841 bool wakeup;
854 int error; 842 int error;
@@ -880,7 +868,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_suspend_late);
880 */ 868 */
881int acpi_dev_resume_early(struct device *dev) 869int acpi_dev_resume_early(struct device *dev)
882{ 870{
883 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 871 struct acpi_device *adev = ACPI_COMPANION(dev);
884 int error; 872 int error;
885 873
886 if (!adev) 874 if (!adev)
@@ -971,7 +959,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
971 */ 959 */
972int acpi_dev_pm_attach(struct device *dev, bool power_on) 960int acpi_dev_pm_attach(struct device *dev, bool power_on)
973{ 961{
974 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 962 struct acpi_device *adev = ACPI_COMPANION(dev);
975 963
976 if (!adev) 964 if (!adev)
977 return -ENODEV; 965 return -ENODEV;
@@ -1003,7 +991,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);
1003 */ 991 */
1004void acpi_dev_pm_detach(struct device *dev, bool power_off) 992void acpi_dev_pm_detach(struct device *dev, bool power_off)
1005{ 993{
1006 struct acpi_device *adev = acpi_dev_pm_get_node(dev); 994 struct acpi_device *adev = ACPI_COMPANION(dev);
1007 995
1008 if (adev && dev->pm_domain == &acpi_general_pm_domain) { 996 if (adev && dev->pm_domain == &acpi_general_pm_domain) {
1009 dev->pm_domain = NULL; 997 dev->pm_domain = NULL;