aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/main.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-01-27 17:47:38 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2010-02-26 14:39:11 -0500
commitf8824cee405c62ba465b85365201166d9cf86a14 (patch)
tree90020be3264ff98bad2f14759127a2d9693673d8 /drivers/base/power/main.c
parent97df8c12995c5bac73e3bfeea4c5be155c1f4401 (diff)
PM: Allow device drivers to use dpm_wait()
There are some dependencies between devices (in particular, between EHCI USB controllers and their OHCI/UHCI siblings) which are not reflected by the structure of the device tree. With synchronous suspend and resume these dependencies are taken into accout automatically, because the devices in question are always registered in the right order, but to meet these constraints with asynchronous suspend and resume the drivers of these devices will need to use dpm_wait() in their suspend/resume routines, so introduce a helper function allowing them to do that. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base/power/main.c')
-rw-r--r--drivers/base/power/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 6efef9fb23a1..0e26a6f6fd48 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1046,3 +1046,14 @@ void __suspend_report_result(const char *function, void *fn, int ret)
1046 printk(KERN_ERR "%s(): %pF returns %d\n", function, fn, ret); 1046 printk(KERN_ERR "%s(): %pF returns %d\n", function, fn, ret);
1047} 1047}
1048EXPORT_SYMBOL_GPL(__suspend_report_result); 1048EXPORT_SYMBOL_GPL(__suspend_report_result);
1049
1050/**
1051 * device_pm_wait_for_dev - Wait for suspend/resume of a device to complete.
1052 * @dev: Device to wait for.
1053 * @subordinate: Device that needs to wait for @dev.
1054 */
1055void device_pm_wait_for_dev(struct device *subordinate, struct device *dev)
1056{
1057 dpm_wait(dev, subordinate->power.async_suspend);
1058}
1059EXPORT_SYMBOL_GPL(device_pm_wait_for_dev);