diff options
| author | David Woodhouse <dwmw2@infradead.org> | 2007-04-26 09:31:28 +0100 |
|---|---|---|
| committer | David Woodhouse <dwmw2@infradead.org> | 2007-04-26 09:31:28 +0100 |
| commit | ef2e58ea6b9931c3a4816c66593da49bb20e3b24 (patch) | |
| tree | ce7432add3becbe78de4ea06425cd2d9e91f4ada /drivers/base/driver.c | |
| parent | 06d63cc51d47f572009138a7f3ac34d95773405d (diff) | |
| parent | de46c33745f5e2ad594c72f2cf5f490861b16ce1 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/base/driver.c')
| -rw-r--r-- | drivers/base/driver.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 1214cbd17d86..082bfded3854 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -183,7 +183,14 @@ int driver_register(struct device_driver * drv) void driver_unregister(struct device_driver * drv) { bus_remove_driver(drv); - wait_for_completion(&drv->unloaded); + /* + * If the driver is a module, we are probably in + * the module unload path, and we want to wait + * for everything to unload before we can actually + * finish the unload. + */ + if (drv->owner) + wait_for_completion(&drv->unloaded); } /** |
