]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/i386/pci/acpi.c
Pull misc into release branch
[linux-2.6-omap-h63xx.git] / arch / i386 / pci / acpi.c
index 2941674f35eb5aae272a3000edd491993ec1b0aa..bc8a44bddaa7b7f8ab83638fbfa38231d631349b 100644 (file)
@@ -2,27 +2,48 @@
 #include <linux/acpi.h>
 #include <linux/init.h>
 #include <linux/irq.h>
-#include <asm/hw_irq.h>
 #include <asm/numa.h>
 #include "pci.h"
 
 struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int domain, int busnum)
 {
        struct pci_bus *bus;
+       struct pci_sysdata *sd;
+       int pxm;
+
+       /* Allocate per-root-bus (not per bus) arch-specific data.
+        * TODO: leak; this memory is never freed.
+        * It's arguable whether it's worth the trouble to care.
+        */
+       sd = kzalloc(sizeof(*sd), GFP_KERNEL);
+       if (!sd) {
+               printk(KERN_ERR "PCI: OOM, not probing PCI bus %02x\n", busnum);
+               return NULL;
+       }
 
        if (domain != 0) {
                printk(KERN_WARNING "PCI: Multiple domains not supported\n");
+               kfree(sd);
                return NULL;
        }
 
-       bus = pcibios_scan_root(busnum);
+       sd->node = -1;
+
+       pxm = acpi_get_pxm(device->handle);
+#ifdef CONFIG_ACPI_NUMA
+       if (pxm >= 0)
+               sd->node = pxm_to_node(pxm);
+#endif
+
+       bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
+       if (!bus)
+               kfree(sd);
+
 #ifdef CONFIG_ACPI_NUMA
        if (bus != NULL) {
-               int pxm = acpi_get_pxm(device->handle);
                if (pxm >= 0) {
-                       bus->sysdata = (void *)(unsigned long)pxm_to_node(pxm);
-                       printk("bus %d -> pxm %d -> node %ld\n",
-                               busnum, pxm, (long)(bus->sysdata));
+                       printk("bus %d -> pxm %d -> node %d\n",
+                               busnum, pxm, sd->node);
                }
        }
 #endif
@@ -54,7 +75,7 @@ static int __init pci_acpi_init(void)
                 * don't use pci_enable_device().
                 */
                printk(KERN_INFO "PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n");
-               while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+               for_each_pci_dev(dev)
                        acpi_pci_irq_enable(dev);
        } else
                printk(KERN_INFO "PCI: If a device doesn't work, try \"pci=routeirq\".  If it helps, post a report\n");