pci: check driver probe return code
authorIntel <intel.com>
Mon, 22 Jul 2013 22:00:00 +0000 (00:00 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 17 Sep 2013 12:16:10 +0000 (14:16 +0200)
Signed-off-by: Intel
lib/librte_eal/common/eal_common_pci.c
lib/librte_eal/linuxapp/eal/eal_pci.c

index bf2a414..97b1a5f 100644 (file)
@@ -115,10 +115,16 @@ static int
 pci_probe_all_drivers(struct rte_pci_device *dev)
 {
        struct rte_pci_driver *dr = NULL;
+       int rc;
 
        dev->blacklisted = !!is_blacklisted(dev);
        TAILQ_FOREACH(dr, &driver_list, next) {
-               if (rte_eal_pci_probe_one_driver(dr, dev))
+               rc = rte_eal_pci_probe_one_driver(dr, dev);
+               if (rc < 0)
+                       /* negative value is an error */
+                       break;
+               if (rc > 0)
+                       /* positive value means driver not found */
                        continue;
                /* initialize subsequent driver instances for this device */
                if ((dr->drv_flags & RTE_PCI_DRV_MULTIPLE) &&
index 063a070..5c7f814 100644 (file)
@@ -978,7 +978,8 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
                /* call the driver devinit() function */
                return dr->devinit(dr, dev);
        }
-       return -1;
+       /* return positive value if driver is not found */
+       return 1;
 }
 
 /* Init the PCI EAL subsystem */