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>
This commit is contained in:
committed by
Jesse Barnes
parent
8c57786ad3
commit
f6e1d8cc38
@@ -97,6 +97,18 @@ static __init struct pci_mmcfg_region *pci_mmconfig_add(int segment, int start,
|
||||
return new;
|
||||
}
|
||||
|
||||
struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus)
|
||||
{
|
||||
struct pci_mmcfg_region *cfg;
|
||||
|
||||
list_for_each_entry(cfg, &pci_mmcfg_list, list)
|
||||
if (cfg->segment == segment &&
|
||||
cfg->start_bus <= bus && bus <= cfg->end_bus)
|
||||
return cfg;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char __init *pci_mmcfg_e7520(void)
|
||||
{
|
||||
u32 win;
|
||||
|
Reference in New Issue
Block a user