[PATCH] pci: don't override drv->shutdown unconditionally

From: Christoph Hellwig
Date: Fri Jun 17 2005 - 13:32:17 EST


There are many drivers that have been setting the generic driver
model­level shutdown callback, and pci thus must not override it.

Without this patch we can have really bad data loss on various
raid controllers.


Index: linux-2.6/drivers/pci/pci-driver.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci-driver.c 2005-05-05 11:01:03.000000000 +0200
+++ linux-2.6/drivers/pci/pci-driver.c 2005-06-17 18:44:52.000000000 +0200
@@ -393,7 +393,8 @@
drv->driver.bus = &pci_bus_type;
drv->driver.probe = pci_device_probe;
drv->driver.remove = pci_device_remove;
- drv->driver.shutdown = pci_device_shutdown,
+ if (!drv->driver.shutdown)
+ drv->driver.shutdown = pci_device_shutdown,
drv->driver.owner = drv->owner;
drv->driver.kobj.ktype = &pci_driver_kobj_type;
pci_init_dynids(&drv->dynids);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/