]> Pileus Git - ~andy/linux/blobdiff - drivers/acpi/device_pm.c
Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica'
[~andy/linux] / drivers / acpi / device_pm.c
index d49f1e46470370908d72b6efb7677d70f80ded98..c14a00d3dca61e5d943c41d5fe11fb90669550a6 100644 (file)
@@ -726,18 +726,6 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
 }
 #endif /* CONFIG_PM_SLEEP */
 
-/**
- * acpi_dev_pm_get_node - Get ACPI device node for the given physical device.
- * @dev: Device to get the ACPI node for.
- */
-struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
-{
-       acpi_handle handle = ACPI_HANDLE(dev);
-       struct acpi_device *adev;
-
-       return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
-}
-
 /**
  * acpi_dev_pm_low_power - Put ACPI device into a low-power state.
  * @dev: Device to put into a low-power state.
@@ -778,7 +766,7 @@ static int acpi_dev_pm_full_power(struct acpi_device *adev)
  */
 int acpi_dev_runtime_suspend(struct device *dev)
 {
-       struct acpi_device *adev = acpi_dev_pm_get_node(dev);
+       struct acpi_device *adev = ACPI_COMPANION(dev);
        bool remote_wakeup;
        int error;
 
@@ -809,7 +797,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_runtime_suspend);
  */
 int acpi_dev_runtime_resume(struct device *dev)
 {
-       struct acpi_device *adev = acpi_dev_pm_get_node(dev);
+       struct acpi_device *adev = ACPI_COMPANION(dev);
        int error;
 
        if (!adev)
@@ -862,7 +850,7 @@ EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume);
  */
 int acpi_dev_suspend_late(struct device *dev)
 {
-       struct acpi_device *adev = acpi_dev_pm_get_node(dev);
+       struct acpi_device *adev = ACPI_COMPANION(dev);
        u32 target_state;
        bool wakeup;
        int error;
@@ -894,7 +882,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_suspend_late);
  */
 int acpi_dev_resume_early(struct device *dev)
 {
-       struct acpi_device *adev = acpi_dev_pm_get_node(dev);
+       struct acpi_device *adev = ACPI_COMPANION(dev);
        int error;
 
        if (!adev)
@@ -985,7 +973,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
  */
 int acpi_dev_pm_attach(struct device *dev, bool power_on)
 {
-       struct acpi_device *adev = acpi_dev_pm_get_node(dev);
+       struct acpi_device *adev = ACPI_COMPANION(dev);
 
        if (!adev)
                return -ENODEV;
@@ -1017,7 +1005,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);
  */
 void acpi_dev_pm_detach(struct device *dev, bool power_off)
 {
-       struct acpi_device *adev = acpi_dev_pm_get_node(dev);
+       struct acpi_device *adev = ACPI_COMPANION(dev);
 
        if (adev && dev->pm_domain == &acpi_general_pm_domain) {
                dev->pm_domain = NULL;