summaryrefslogtreecommitdiff
path: root/drivers/acpi/device_pm.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-07-31 22:40:03 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-07-31 22:40:03 +0300
commit50ba22479c324c0d9dc8134d519dcba92d83a8a7 (patch)
tree0f939779c7ff97d1b4e923a4fbded2718e09e4d3 /drivers/acpi/device_pm.c
parent71b65445f0ed04c2afe3660f829779fddb2890c1 (diff)
parent3431e490b50356b56084305a2e93b3a980802b22 (diff)
downloadlinux-50ba22479c324c0d9dc8134d519dcba92d83a8a7.tar.xz
Merge back earlier ACPI PM material for v4.3.
Diffstat (limited to 'drivers/acpi/device_pm.c')
-rw-r--r--drivers/acpi/device_pm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 88dbbb115285..337e8118836d 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -1123,6 +1123,14 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
if (dev->pm_domain)
return -EEXIST;
+ /*
+ * Only attach the power domain to the first device if the
+ * companion is shared by multiple. This is to prevent doing power
+ * management twice.
+ */
+ if (!acpi_device_is_first_physical_node(adev, dev))
+ return -EBUSY;
+
acpi_add_pm_notifier(adev, dev, acpi_pm_notify_work_func);
dev->pm_domain = &acpi_general_pm_domain;
if (power_on) {