diff options
-rw-r--r-- | drivers/base/power/main.c | 11 | ||||
-rw-r--r-- | include/linux/pm.h | 2 |
2 files changed, 13 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 | } |
1048 | EXPORT_SYMBOL_GPL(__suspend_report_result); | 1048 | EXPORT_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 | */ | ||
1055 | void device_pm_wait_for_dev(struct device *subordinate, struct device *dev) | ||
1056 | { | ||
1057 | dpm_wait(dev, subordinate->power.async_suspend); | ||
1058 | } | ||
1059 | EXPORT_SYMBOL_GPL(device_pm_wait_for_dev); | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 9c16cd20fc96..e80df06ad22a 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -512,6 +512,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
512 | __suspend_report_result(__func__, fn, ret); \ | 512 | __suspend_report_result(__func__, fn, ret); \ |
513 | } while (0) | 513 | } while (0) |
514 | 514 | ||
515 | extern void device_pm_wait_for_dev(struct device *sub, struct device *dev); | ||
515 | #else /* !CONFIG_PM_SLEEP */ | 516 | #else /* !CONFIG_PM_SLEEP */ |
516 | 517 | ||
517 | #define device_pm_lock() do {} while (0) | 518 | #define device_pm_lock() do {} while (0) |
@@ -524,6 +525,7 @@ static inline int dpm_suspend_start(pm_message_t state) | |||
524 | 525 | ||
525 | #define suspend_report_result(fn, ret) do {} while (0) | 526 | #define suspend_report_result(fn, ret) do {} while (0) |
526 | 527 | ||
528 | static inline void device_pm_wait_for_dev(struct device *a, struct device *b) {} | ||
527 | #endif /* !CONFIG_PM_SLEEP */ | 529 | #endif /* !CONFIG_PM_SLEEP */ |
528 | 530 | ||
529 | /* How to reorder dpm_list after device_move() */ | 531 | /* How to reorder dpm_list after device_move() */ |