ACPI / PM: Assign the ->detach() callback when attaching the PM domain
authorUlf Hansson <ulf.hansson@linaro.org>
Fri, 19 Sep 2014 18:27:35 +0000 (20:27 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 Sep 2014 13:57:40 +0000 (15:57 +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>
drivers/acpi/device_pm.c

index 67075f800e34cb69b3a28d852b9bc15b00ffa702..eec5ed5be9499c288519ce74d149d54770ed0458 100644 (file)
@@ -1072,6 +1072,8 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
                acpi_dev_pm_full_power(adev);
                acpi_device_wakeup(adev, ACPI_STATE_S0, false);
        }
+
+       dev->pm_domain->detach = acpi_dev_pm_detach;
        return 0;
 }
 EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);