]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/base/driver.c
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[mv-sheeva.git] / drivers / base / driver.c
index 1214cbd17d868bf1613bcf79ee079cabef95ca62..082bfded38544b0fc055861a79112446ae6199c9 100644 (file)
@@ -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);
 }
 
 /**