Skip to contentSkip to conversation

testing for probe errors in pci-driver.c

PATCH New Janice M Girouard 1 participant 1 message Aug 8, 2003 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 testing for probe errors in pci-driver.c

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

drivers/pci/pci-driver.c +2 -4
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
@@ -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;
 }