diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2009-11-13 19:34:54 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-24 18:30:24 -0500 |
commit | ba2afbabfc44d6322e8607c004f37868ff786cf8 (patch) | |
tree | 654a143fb536273039fe21537f0cee7863fbe6c9 | |
parent | ff097ddd4aeac790fd51d013c79c2f18ec9a7117 (diff) |
x86/PCI: MMCONFIG: add pci_mmconfig_remove() to remove MMCONFIG region
This is only used internally now, but eventually will be used in the
hot-remove path to remove the MMCONFIG region associated with a host bridge.
Reviewed-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | arch/x86/pci/mmconfig-shared.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 2709aa81801d..392f8fe16955 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c | |||
@@ -27,17 +27,21 @@ static int __initdata pci_mmcfg_resources_inserted; | |||
27 | 27 | ||
28 | LIST_HEAD(pci_mmcfg_list); | 28 | LIST_HEAD(pci_mmcfg_list); |
29 | 29 | ||
30 | static __init void pci_mmconfig_remove(struct pci_mmcfg_region *cfg) | ||
31 | { | ||
32 | if (cfg->res.parent) | ||
33 | release_resource(&cfg->res); | ||
34 | list_del(&cfg->list); | ||
35 | kfree(cfg); | ||
36 | } | ||
37 | |||
30 | static __init void free_all_mmcfg(void) | 38 | static __init void free_all_mmcfg(void) |
31 | { | 39 | { |
32 | struct pci_mmcfg_region *cfg, *tmp; | 40 | struct pci_mmcfg_region *cfg, *tmp; |
33 | 41 | ||
34 | pci_mmcfg_arch_free(); | 42 | pci_mmcfg_arch_free(); |
35 | list_for_each_entry_safe(cfg, tmp, &pci_mmcfg_list, list) { | 43 | list_for_each_entry_safe(cfg, tmp, &pci_mmcfg_list, list) |
36 | if (cfg->res.parent) | 44 | pci_mmconfig_remove(cfg); |
37 | release_resource(&cfg->res); | ||
38 | list_del(&cfg->list); | ||
39 | kfree(cfg); | ||
40 | } | ||
41 | } | 45 | } |
42 | 46 | ||
43 | static __init void list_add_sorted(struct pci_mmcfg_region *new) | 47 | static __init void list_add_sorted(struct pci_mmcfg_region *new) |