diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-01-24 13:52:25 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-03 12:38:23 -0500 |
commit | 289a24a699ff808a9ebfaaf4c2759cb86932f664 (patch) | |
tree | 9f52a7be0502abe5bb4244472a52736a2173685d | |
parent | 3d2a366190778f30a2f10b5edaf32bcb236840fd (diff) |
x86/PCI: Merge pci_scan_bus_on_node() into pcibios_scan_root()
pci_scan_bus_on_node() is only called by pcibios_scan_root().
This merges pci_scan_bus_on_node() into pcibios_scan_root() and removes
pci_scan_bus_on_node().
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | arch/x86/include/asm/pci.h | 4 | ||||
-rw-r--r-- | arch/x86/pci/common.c | 49 |
2 files changed, 19 insertions, 34 deletions
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 4e891abf8b48..b52f9c0ec5fb 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h | |||
@@ -26,10 +26,6 @@ extern int pci_routeirq; | |||
26 | extern int noioapicquirk; | 26 | extern int noioapicquirk; |
27 | extern int noioapicreroute; | 27 | extern int noioapicreroute; |
28 | 28 | ||
29 | /* scan a bus after allocating a pci_sysdata for it */ | ||
30 | extern struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, | ||
31 | int node); | ||
32 | |||
33 | #ifdef CONFIG_PCI | 29 | #ifdef CONFIG_PCI |
34 | 30 | ||
35 | #ifdef CONFIG_PCI_DOMAINS | 31 | #ifdef CONFIG_PCI_DOMAINS |
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 | ||
459 | struct pci_bus *pcibios_scan_root(int busnum) | 459 | struct 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 | ||
465 | void __init pcibios_set_cache_line_size(void) | 482 | void __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 | ||
672 | struct 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 | * |