summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Sharp <andywyse6@gmail.com>2012-08-29 14:16:30 +0000
committerWolfgang Denk <wd@denx.de>2012-09-02 14:18:19 +0200
commit03992ac2c974ae3e169219ba0ccdd94a8ce0146a (patch)
tree16bfb0956b5f1e30e462b30b3407a87c273642eb
parentcb2bf931dcca9ed0ee514680ed99d51b45036aa9 (diff)
downloadu-boot-imx-03992ac2c974ae3e169219ba0ccdd94a8ce0146a.zip
u-boot-imx-03992ac2c974ae3e169219ba0ccdd94a8ce0146a.tar.gz
u-boot-imx-03992ac2c974ae3e169219ba0ccdd94a8ce0146a.tar.bz2
pci: minor cleanup of CONFIG_PCI_PNP usage
Refactor the common PCI code just a tiny bit surrounding the PCI_PNP (pciauto) stuff. Makes the code a tiny bit easier to read, and also makes it more obvious that almost no platform needs to setup or use the pci_config_table stuff. Signed-off-by: Andrew Sharp <andywyse6@gmail.com>
-rw-r--r--drivers/pci/pci.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 62cb969..2a6d0a7 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -627,7 +627,9 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
unsigned int sub_bus, found_multi = 0;
unsigned short vendor, device, class;
unsigned char header_type;
+#ifndef CONFIG_PCI_PNP
struct pci_config_table *cfg;
+#endif
pci_dev_t dev;
#ifdef CONFIG_PCI_SCAN_SHOW
static int indent = 0;
@@ -675,18 +677,16 @@ 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);
+#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);
-#ifdef CONFIG_PCI_PNP
- } else {
- int n = pciauto_config_device(hose, dev);
-
- sub_bus = max(sub_bus, n);
-#endif
}
+#endif
#ifdef CONFIG_PCI_SCAN_SHOW
indent--;