MIPS: Fix build breakage if CONFIG_DEBUG_FS is enabled.
[safe/jmp/linux-2.6] / arch / x86 / pci / legacy.c
index d8b6e92..0db5eaf 100644 (file)
@@ -3,7 +3,7 @@
  */
 #include <linux/init.h>
 #include <linux/pci.h>
-#include "pci.h"
+#include <asm/pci_x86.h>
 
 /*
  * Discover remaining PCI buses in case there are peer host bridges.
@@ -14,7 +14,7 @@ static void __devinit pcibios_fixup_peer_bridges(void)
        int n, devfn;
        long node;
 
-       if (pcibios_last_bus <= 0 || pcibios_last_bus >= 0xff)
+       if (pcibios_last_bus <= 0 || pcibios_last_bus > 0xff)
                return;
        DBG("PCI: Peer bridge fixup\n");
 
@@ -35,36 +35,34 @@ static void __devinit pcibios_fixup_peer_bridges(void)
        }
 }
 
-static int __init pci_legacy_init(void)
+int __init pci_legacy_init(void)
 {
        if (!raw_pci_ops) {
                printk("PCI: System does not support PCI\n");
                return 0;
        }
 
-       if (pcibios_scanned++)
-               return 0;
-
        printk("PCI: Probing PCI hardware\n");
        pci_root_bus = pcibios_scan_root(0);
        if (pci_root_bus)
                pci_bus_add_devices(pci_root_bus);
 
-       pcibios_fixup_peer_bridges();
-
        return 0;
 }
 
 int __init pci_subsys_init(void)
 {
-#ifdef CONFIG_ACPI
-       pci_acpi_init();
-#endif
-       pci_legacy_init();
-       pcibios_irq_init();
-#ifdef CONFIG_X86_NUMAQ
-       pci_numa_init();
-#endif
+       /*
+        * The init function returns an non zero value when
+        * pci_legacy_init should be invoked.
+        */
+       if (x86_init.pci.init())
+               pci_legacy_init();
+
+       pcibios_fixup_peer_bridges();
+       x86_init.pci.init_irq();
        pcibios_init();
+
+       return 0;
 }
 subsys_initcall(pci_subsys_init);