X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fbase%2Fdriver.c;h=082bfded38544b0fc055861a79112446ae6199c9;hb=411ed3225733dbd83b4cbaaa992ef80d6ec1534e;hp=1214cbd17d868bf1613bcf79ee079cabef95ca62;hpb=fecf3404f4aba6d0edeba31eeb018cbb6326dff2;p=linux-2.6-omap-h63xx.git diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 1214cbd17d8..082bfded385 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); } /**