aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/pci/common.c')
-rw-r--r--arch/x86/pci/common.c49
1 files changed, 19 insertions, 30 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index f530c7e93250..52ad00c2e198 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -458,8 +458,25 @@ void __init dmi_check_pciprobe(void)
458 458
459struct pci_bus *pcibios_scan_root(int busnum) 459struct pci_bus *pcibios_scan_root(int busnum)
460{ 460{
461 return pci_scan_bus_on_node(busnum, &pci_root_ops, 461 struct pci_bus *bus;
462 get_mp_bus_to_node(busnum)); 462 struct pci_sysdata *sd;
463 LIST_HEAD(resources);
464
465 sd = kzalloc(sizeof(*sd), GFP_KERNEL);
466 if (!sd) {
467 printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busnum);
468 return NULL;
469 }
470 sd->node = get_mp_bus_to_node(busnum);
471 x86_pci_root_bus_resources(busnum, &resources);
472 printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum);
473 bus = pci_scan_root_bus(NULL, busnum, &pci_root_ops, sd, &resources);
474 if (!bus) {
475 pci_free_resource_list(&resources);
476 kfree(sd);
477 }
478
479 return bus;
463} 480}
464 481
465void __init pcibios_set_cache_line_size(void) 482void __init pcibios_set_cache_line_size(void)
@@ -669,34 +686,6 @@ int pci_ext_cfg_avail(void)
669 return 0; 686 return 0;
670} 687}
671 688
672struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node)
673{
674 LIST_HEAD(resources);
675 struct pci_bus *bus = NULL;
676 struct pci_sysdata *sd;
677
678 /*
679 * Allocate per-root-bus (not per bus) arch-specific data.
680 * TODO: leak; this memory is never freed.
681 * It's arguable whether it's worth the trouble to care.
682 */
683 sd = kzalloc(sizeof(*sd), GFP_KERNEL);
684 if (!sd) {
685 printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busno);
686 return NULL;
687 }
688 sd->node = node;
689 x86_pci_root_bus_resources(busno, &resources);
690 printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busno);
691 bus = pci_scan_root_bus(NULL, busno, ops, sd, &resources);
692 if (!bus) {
693 pci_free_resource_list(&resources);
694 kfree(sd);
695 }
696
697 return bus;
698}
699
700/* 689/*
701 * NUMA info for PCI busses 690 * NUMA info for PCI busses
702 * 691 *