PCI: Use common resource list management code instead of private implementation

Use common resource list management data structure and interfaces
instead of private implementation.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Jiang Liu
2015-02-05 13:44:44 +08:00
committed by Rafael J. Wysocki
parent 90e9782061
commit 14d76b68f2
9 changed files with 27 additions and 39 deletions
+6 -12
View File
@@ -20,17 +20,16 @@
void pci_add_resource_offset(struct list_head *resources, struct resource *res,
resource_size_t offset)
{
struct pci_host_bridge_window *window;
struct resource_entry *entry;
window = kzalloc(sizeof(struct pci_host_bridge_window), GFP_KERNEL);
if (!window) {
entry = resource_list_create_entry(res, 0);
if (!entry) {
printk(KERN_ERR "PCI: can't add host bridge window %pR\n", res);
return;
}
window->res = res;
window->offset = offset;
list_add_tail(&window->list, resources);
entry->offset = offset;
resource_list_add_tail(entry, resources);
}
EXPORT_SYMBOL(pci_add_resource_offset);
@@ -42,12 +41,7 @@ EXPORT_SYMBOL(pci_add_resource);
void pci_free_resource_list(struct list_head *resources)
{
struct pci_host_bridge_window *window, *tmp;
list_for_each_entry_safe(window, tmp, resources, list) {
list_del(&window->list);
kfree(window);
}
resource_list_free(resources);
}
EXPORT_SYMBOL(pci_free_resource_list);