[PATCH] testing for probe errors in pci-driver.c

From: Janice M Girouard
Date: Fri Aug 08 2003 - 13:53:22 EST


Currently if __pci_device_probe locates the correct
device driver, but receives an error from the static
drv->probe function, this error is not reported.

The attached patch reports the above error condition
to the caller. Only when a match for the device in
the static tables is not found, is the dynamic driver table searched.

Janice



diff -Naur linux-2.6.0-test2.orig.pci/drivers/pci/pci-driver.c linux-2.6.0-test2.my.pci/drivers/pci/pci-driver.c
--- linux-2.6.0-test2.orig.pci/drivers/pci/pci-driver.c 2003-08-07 16:14:36.000000000 -0500
+++ linux-2.6.0-test2.my.pci/drivers/pci/pci-driver.c 2003-08-07 21:23:51.000000000 -0500
@@ -122,10 +122,8 @@

if (!pci_dev->driver && drv->probe) {
error = pci_device_probe_static(drv, pci_dev);
- if (error >= 0)
- return error;
-
- error = pci_device_probe_dynamic(drv, pci_dev);
+ if (error == -ENODEV)
+ error = pci_device_probe_dynamic(drv, pci_dev);
}
return error;
}