ACPI / PM: Assign the ->detach() callback when attaching the PM domain
Ulf Hansson [Fri, 19 Sep 2014 18:27:35 +0000 (20:27 +0200)]
As as preparation to simplify the detachment of devices from their PM
domains, we assign the ->detach() callback to genpd_dev_pm_detach().

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Change-Id: Id6896ac98b123969c9aa282cf71970a2786f9fb7
Reviewed-on: http://git-master/r/660533
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/acpi/device_pm.c

index 553527c..3e865d2 100644 (file)
@@ -965,6 +965,8 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
                acpi_dev_pm_full_power(adev);
                __acpi_device_run_wake(adev, false);
        }
+
+       dev->pm_domain->detach = acpi_dev_pm_detach;
        return 0;
 }
 EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);