diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-21 17:17:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-21 17:17:26 -0500 |
commit | adfafefd104d840ee4461965f22624d77532675b (patch) | |
tree | 6c6ba553a2b11703bf5952bd789905ea37c4fc4f /drivers | |
parent | 460c1338fc05add0e8050d4945a46f207b13a5fc (diff) | |
parent | 403f307576396f3362fbb65af190885b6036c72c (diff) |
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.c | 17 |
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 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
21 | #include <linux/delay.h> | ||
21 | #include <linux/module.h> | 22 | #include <linux/module.h> |
22 | #include <linux/kthread.h> | 23 | #include <linux/kthread.h> |
23 | #include <linux/wait.h> | 24 | #include <linux/wait.h> |
25 | #include <linux/async.h> | ||
24 | 26 | ||
25 | #include "base.h" | 27 | #include "base.h" |
26 | #include "power/power.h" | 28 | #include "power/power.h" |
@@ -168,6 +170,21 @@ int driver_probe_done(void) | |||
168 | } | 170 | } |
169 | 171 | ||
170 | /** | 172 | /** |
173 | * wait_for_device_probe | ||
174 | * Wait for device probing to be completed. | ||
175 | * | ||
176 | * Note: this function polls at 100 msec intervals. | ||
177 | */ | ||
178 | int wait_for_device_probe(void) | ||
179 | { | ||
180 | /* wait for the known devices to complete their probing */ | ||
181 | while (driver_probe_done() != 0) | ||
182 | msleep(100); | ||
183 | async_synchronize_full(); | ||
184 | return 0; | ||
185 | } | ||
186 | |||
187 | /** | ||
171 | * driver_probe_device - attempt to bind device & driver together | 188 | * driver_probe_device - attempt to bind device & driver together |
172 | * @drv: driver to bind a device to | 189 | * @drv: driver to bind a device to |
173 | * @dev: device to try to bind to the driver | 190 | * @dev: device to try to bind to the driver |