Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5ef2abc authored by Linus Torvalds's avatar Linus Torvalds
Browse files

driver core: do not wait unnecessarily in driver_unregister()



Ingo reported that built-in drivers suffered bootup hangs with certain
driver unregistry sequences, due to sysfs breakage.

Do the minimal fix for v2.6.21: only wait if the driver is a module.

Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 755948cf
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -183,6 +183,13 @@ int driver_register(struct device_driver * drv)
void driver_unregister(struct device_driver * drv)
{
	bus_remove_driver(drv);
	/*
	 * 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);
}