summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds2009-02-21 23:17:26 +0100
committerLinus Torvalds2009-02-21 23:17:26 +0100
commitadfafefd104d840ee4461965f22624d77532675b (patch)
tree6c6ba553a2b11703bf5952bd789905ea37c4fc4f /drivers
parentMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kern... (diff)
parentPM: Fix suspend_console and resume_console to use only one semaphore (diff)
downloadkernel-qcow2-linux-adfafefd104d840ee4461965f22624d77532675b.tar.gz
kernel-qcow2-linux-adfafefd104d840ee4461965f22624d77532675b.tar.xz
kernel-qcow2-linux-adfafefd104d840ee4461965f22624d77532675b.zip
Merge branch 'hibernate'
* hibernate: PM: Fix suspend_console and resume_console to use only one semaphore PM: Wait for console in resume PM: Fix pm_notifiers during user mode hibernation swsusp: clean up shrink_all_zones() swsusp: dont fiddle with swappiness PM: fix build for CONFIG_PM unset PM/hibernate: fix "swap breaks after hibernation failures" PM/resume: wait for device probing to finish Consolidate driver_probe_done() loops into one place
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/dd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 315bed8d5e7f..135231239103 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -18,9 +18,11 @@
*/
#include <linux/device.h>
+#include <linux/delay.h>
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/wait.h>
+#include <linux/async.h>
#include "base.h"
#include "power/power.h"
@@ -168,6 +170,21 @@ int driver_probe_done(void)
}
/**
+ * wait_for_device_probe
+ * Wait for device probing to be completed.
+ *
+ * Note: this function polls at 100 msec intervals.
+ */
+int wait_for_device_probe(void)
+{
+ /* wait for the known devices to complete their probing */
+ while (driver_probe_done() != 0)
+ msleep(100);
+ async_synchronize_full();
+ return 0;
+}
+
+/**
* driver_probe_device - attempt to bind device & driver together
* @drv: driver to bind a device to
* @dev: device to try to bind to the driver