Re: Patch: linux-2.5.42/kernel/sys.c - warm reboot should not suspend devices

Eric W. Biederman
2002-10-20T09:45:53Z

Assuming it is worth it to split remove into 2 parts, we need
the following so rmmod calls ->shutdown. Otherwise we will get
code duplication in the drivers.

And then we need all of the patches that split remove into 2 parts,
in the drivers.

Eric

diff -uNr linux-2.5.44/drivers/base/bus.c linux-2.5.44.shutdown/drivers/base/bus.c
--- linux-2.5.44/drivers/base/bus.c Sat Oct 19 00:57:58 2002
+++ linux-2.5.44.shutdown/drivers/base/bus.c Sun Oct 20 03:44:46 2002
@@ -164,6 +164,8 @@
if (drv) {
list_del_init(&dev->driver_list);
devclass_remove_device(dev);
+ if (drv->shutdown && device_present(drv))
+ drv->shutdown(dev);
if (drv->remove)
drv->remove(dev);
dev->driver = NULL;