]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/pci/pci.c
pci: Honour pci_skip_dev()
[karo-tx-uboot.git] / drivers / pci / pci.c
index 28859f31612527ccff49ee3fbc69dbbc1caaaa54..7ee21d1c1d1d039c734a64f635e0c8236569b422 100644 (file)
@@ -195,6 +195,9 @@ pci_dev_t pci_find_devices(struct pci_device_id *ids, int index)
                             bdf < PCI_BDF(bus + 1, 0, 0);
 #endif
                             bdf += PCI_BDF(0, 0, 1)) {
+                               if (pci_skip_dev(hose, bdf))
+                                       continue;
+
                                if (!PCI_FUNC(bdf)) {
                                        pci_read_config_byte(bdf,
                                                             PCI_HEADER_TYPE,
@@ -572,7 +575,7 @@ const char * pci_class_str(u8 class)
 }
 #endif /* CONFIG_CMD_PCI || CONFIG_PCI_SCAN_SHOW */
 
-int __pci_skip_dev(struct pci_controller *hose, pci_dev_t dev)
+__weak int pci_skip_dev(struct pci_controller *hose, pci_dev_t dev)
 {
        /*
         * Check if pci device should be skipped in configuration
@@ -591,19 +594,15 @@ int __pci_skip_dev(struct pci_controller *hose, pci_dev_t dev)
 
        return 0;
 }
-int pci_skip_dev(struct pci_controller *hose, pci_dev_t dev)
-       __attribute__((weak, alias("__pci_skip_dev")));
 
 #ifdef CONFIG_PCI_SCAN_SHOW
-int __pci_print_dev(struct pci_controller *hose, pci_dev_t dev)
+__weak int pci_print_dev(struct pci_controller *hose, pci_dev_t dev)
 {
        if (dev == PCI_BDF(hose->first_busno, 0, 0))
                return 0;
 
        return 1;
 }
-int pci_print_dev(struct pci_controller *hose, pci_dev_t dev)
-       __attribute__((weak, alias("__pci_print_dev")));
 #endif /* CONFIG_PCI_SCAN_SHOW */
 
 int pci_hose_scan_bus(struct pci_controller *hose, int bus)
@@ -666,13 +665,15 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
 #endif
 
 #ifdef CONFIG_PCI_PNP
-               sub_bus = max(pciauto_config_device(hose, dev), sub_bus);
+               sub_bus = max((unsigned int)pciauto_config_device(hose, dev),
+                             sub_bus);
 #else
                cfg = pci_find_config(hose, class, vendor, device,
                                      PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev));
                if (cfg) {
                        cfg->config_device(hose, dev, cfg);
-                       sub_bus = max(sub_bus, hose->current_busno);
+                       sub_bus = max(sub_bus,
+                                     (unsigned int)hose->current_busno);
                }
 #endif