]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/i386/pci/common.c
x86-64: introduce struct pci_sysdata to facilitate sharing of ->sysdata
[linux-2.6-omap-h63xx.git] / arch / i386 / pci / common.c
index 3f78d4d8ecf31a00798e00790e52a81404a4cee0..85503deeda46cbd336c5cf3e15bcb6a4998b8d10 100644 (file)
@@ -293,6 +293,7 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
 struct pci_bus * __devinit pcibios_scan_root(int busnum)
 {
        struct pci_bus *bus = NULL;
+       struct pci_sysdata *sd;
 
        dmi_check_system(pciprobe_dmi_table);
 
@@ -303,9 +304,19 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
                }
        }
 
+       /* 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;
+       }
+
        printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum);
 
-       return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL);
+       return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd);
 }
 
 extern u8 pci_cache_line_size;