pci: use lookup tailq api
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci.c
index f880f90..8f44f09 100644 (file)
@@ -440,8 +440,8 @@ error:
  * Scan the content of the PCI bus, and the devices in the devices
  * list
  */
-static int
-pci_scan(void)
+int
+rte_eal_pci_scan(void)
 {
        struct dirent *e;
        DIR *dir;
@@ -766,14 +766,14 @@ rte_eal_pci_init(void)
 {
        TAILQ_INIT(&pci_driver_list);
        TAILQ_INIT(&pci_device_list);
-       pci_res_list = RTE_TAILQ_RESERVE_BY_IDX(RTE_TAILQ_PCI,
-                       mapped_pci_res_list);
+       pci_res_list = RTE_TAILQ_LOOKUP_BY_IDX(RTE_TAILQ_PCI,
+                                              mapped_pci_res_list);
 
        /* for debug purposes, PCI can be disabled */
        if (internal_config.no_pci)
                return 0;
 
-       if (pci_scan() < 0) {
+       if (rte_eal_pci_scan() < 0) {
                RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__);
                return -1;
        }