From: Intel Date: Mon, 22 Jul 2013 22:00:00 +0000 (+0200) Subject: pci: check driver probe return code X-Git-Tag: spdx-start~11177 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9dc8cd6ef7e3c4a045e0b965a9f58499cedfde25;p=dpdk.git pci: check driver probe return code Signed-off-by: Intel --- diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index bf2a4143ac..97b1a5f869 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -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) && diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 063a070db9..5c7f814026 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -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 */