From c80f1206f57ba034d45602f25ff406407bdd6ad3 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 27 Jan 2010 23:47:38 +0100 Subject: [PATCH] --- yaml --- r: 181857 b: refs/heads/master c: f8824cee405c62ba465b85365201166d9cf86a14 h: refs/heads/master i: 181855: d431317dd62d1d55712ca5d3692ca21ea842c23f v: v3 --- [refs] | 2 +- trunk/drivers/base/power/main.c | 11 +++++++++++ trunk/include/linux/pm.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 63894cfb096a..12caa703ca97 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 97df8c12995c5bac73e3bfeea4c5be155c1f4401 +refs/heads/master: f8824cee405c62ba465b85365201166d9cf86a14 diff --git a/trunk/drivers/base/power/main.c b/trunk/drivers/base/power/main.c index 6efef9fb23a1..0e26a6f6fd48 100644 --- a/trunk/drivers/base/power/main.c +++ b/trunk/drivers/base/power/main.c @@ -1046,3 +1046,14 @@ void __suspend_report_result(const char *function, void *fn, int ret) printk(KERN_ERR "%s(): %pF returns %d\n", function, fn, ret); } EXPORT_SYMBOL_GPL(__suspend_report_result); + +/** + * device_pm_wait_for_dev - Wait for suspend/resume of a device to complete. + * @dev: Device to wait for. + * @subordinate: Device that needs to wait for @dev. + */ +void device_pm_wait_for_dev(struct device *subordinate, struct device *dev) +{ + dpm_wait(dev, subordinate->power.async_suspend); +} +EXPORT_SYMBOL_GPL(device_pm_wait_for_dev); diff --git a/trunk/include/linux/pm.h b/trunk/include/linux/pm.h index 9c16cd20fc96..e80df06ad22a 100644 --- a/trunk/include/linux/pm.h +++ b/trunk/include/linux/pm.h @@ -512,6 +512,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); __suspend_report_result(__func__, fn, ret); \ } while (0) +extern void device_pm_wait_for_dev(struct device *sub, struct device *dev); #else /* !CONFIG_PM_SLEEP */ #define device_pm_lock() do {} while (0) @@ -524,6 +525,7 @@ static inline int dpm_suspend_start(pm_message_t state) #define suspend_report_result(fn, ret) do {} while (0) +static inline void device_pm_wait_for_dev(struct device *a, struct device *b) {} #endif /* !CONFIG_PM_SLEEP */ /* How to reorder dpm_list after device_move() */