summaryrefslogtreecommitdiff
path: root/drivers/base/power/common.c
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2016-01-07 15:46:14 (GMT)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-08 00:12:06 (GMT)
commitaa8e54b559479d0cb7eb632ba443b8cacd20cd4b (patch)
tree73e96c085acbcd7170f0acfabcaee69b54d83a23 /drivers/base/power/common.c
parent989561de9b5112999475b406557d9c7e9e59c041 (diff)
downloadlinux-aa8e54b559479d0cb7eb632ba443b8cacd20cd4b.tar.xz
PM / sleep: Go direct_complete if driver has no callbacks
If a suitable prepare callback cannot be found for a given device and its driver has no PM callbacks at all, assume that it can go direct to complete when the system goes to sleep. The reason for this is that there's lots of devices in a system that do no PM at all and there's no reason for them to prevent their ancestors to do direct_complete if they can support it. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/power/common.c')
-rw-r--r--drivers/base/power/common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
index 02812bc..93ed14c 100644
--- a/drivers/base/power/common.c
+++ b/drivers/base/power/common.c
@@ -14,6 +14,8 @@
#include <linux/acpi.h>
#include <linux/pm_domain.h>
+#include "power.h"
+
/**
* dev_pm_get_subsys_data - Create or refcount power.subsys_data for device.
* @dev: Device to handle.
@@ -147,5 +149,6 @@ void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd)
WARN(device_is_bound(dev),
"PM domains can only be changed for unbound devices\n");
dev->pm_domain = pd;
+ device_pm_check_callbacks(dev);
}
EXPORT_SYMBOL_GPL(dev_pm_domain_set);