Use pci_find_bus rather than relying on the return value of pci_scan_bus.

diff -u -p -r1.7 irq.c
--- a/arch/i386/pci/irq.c       23 Jun 2003 03:29:59 -0000      1.7
+++ b/arch/i386/pci/irq.c       3 Jul 2003 01:11:41 -0000
@@ -102,13 +102,12 @@ static void __init pirq_peer_trick(void)
#endif
               busmap[e->bus] = 1;
       }
-       for(i=1; i<256; i++)
-               /*
-                *  It might be a secondary bus, but in this case its parent is already
-                *  known (ascending bus order) and therefore pci_scan_bus returns immediately.
-                */
-               if (busmap[i] && pci_scan_bus(i, &pci_root_ops, NULL))
+       for(i = 1; i < 256; i++) {
+               if (!busmap[i] || pci_find_bus(0, i))
+                       continue;
+               if (pci_scan_bus(i, &pci_root_ops, NULL))
                       printk(KERN_INFO "PCI: Discovered primary peer bus %02x [IRQ]\n", i);
+       }
       pcibios_last_bus = -1;
}