* Patch by Thomas Frieden, 13 Nov 2002:
  Add code for AmigaOne board
  (preliminary merge to U-Boot, still WIP)

* Patch by Jon Diekema, 12 Nov 2002:
  - Adding URL for IEEE OUI lookup
  - Making the autoboot #defines dependent on CONFIG_AUTOBOOT_KEYED
    being defined.
  - In the CONFIG_EXTRA_ENV_SETTINGS #define, the root-on-initrd and
    root-on-nfs macros are designed to switch how the default boot
    method gets defined.
diff --git a/drivers/pci.c b/drivers/pci.c
index 52584ce..dc58abf 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -421,8 +421,11 @@
  *
  */
 
+/* HJF: Changed this to return int. I think this is required
+ * to get the correct result when scanning bridges
+ */
+extern int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev);
 extern void pciauto_config_init(struct pci_controller *hose);
-extern void pciauto_config_device(struct pci_controller *hose, pci_dev_t dev);
 
 int pci_hose_scan_bus(struct pci_controller *hose, int bus)
 {
@@ -451,8 +454,7 @@
 
 		pci_hose_read_config_word(hose, dev, PCI_VENDOR_ID, &vendor);
 
-		if (vendor != 0xffff && vendor != 0x0000)
-		{
+		if (vendor != 0xffff && vendor != 0x0000) {
 
 			if (!PCI_FUNC(dev))
 				found_multi = header_type & 0x80;
@@ -465,12 +467,15 @@
 
 			cfg = pci_find_config(hose, class, vendor, device,
 					      PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev));
-			if (cfg)
+			if (cfg) {
 				cfg->config_device(hose, dev, cfg);
 #ifdef CONFIG_PCI_PNP
-			else
-				pciauto_config_device(hose, dev);
+			} else {
+				int n = pciauto_config_device(hose, dev);
+
+				sub_bus = max(sub_bus, n);
 #endif
+			}
 			if (hose->fixup_irq)
 				hose->fixup_irq(hose, dev);