diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2009-11-14 01:35:04 +0100 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-25 00:30:36 +0100 |
commit | f6e1d8cc38b3776038fb15d3acc82ed8bb552f82 (patch) | |
tree | d6ff3745b8f3843bad4cf284e653e38ba3b0a693 /arch/x86/pci/mmconfig_32.c | |
parent | x86/PCI: MMCONFIG: clean up printks (diff) | |
download | linux-f6e1d8cc38b3776038fb15d3acc82ed8bb552f82.tar.xz linux-f6e1d8cc38b3776038fb15d3acc82ed8bb552f82.zip |
x86/PCI: MMCONFIG: add lookup function
This patch factors out the search for an MMCONFIG region, which was
previously implemented in both mmconfig_32 and mmconfig_64. No functional
change.
Reviewed-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/x86/pci/mmconfig_32.c')
-rw-r--r-- | arch/x86/pci/mmconfig_32.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c index c04523e09649..90d5fd476ed4 100644 --- a/arch/x86/pci/mmconfig_32.c +++ b/arch/x86/pci/mmconfig_32.c @@ -27,15 +27,10 @@ static int mmcfg_last_accessed_cpu; */ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn) { - struct pci_mmcfg_region *cfg; + struct pci_mmcfg_region *cfg = pci_mmconfig_lookup(seg, bus); - list_for_each_entry(cfg, &pci_mmcfg_list, list) - if (cfg->segment == seg && - (cfg->start_bus <= bus) && - (cfg->end_bus >= bus)) - return cfg->address; - - /* Fall back to type 0 */ + if (cfg) + return cfg->address; return 0; } |