aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/bus.c')
-rw-r--r--drivers/pci/bus.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 398f5d859791..4ce5ef2f2826 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -18,28 +18,36 @@
18 18
19#include "pci.h" 19#include "pci.h"
20 20
21void pci_add_resource(struct list_head *resources, struct resource *res) 21void pci_add_resource_offset(struct list_head *resources, struct resource *res,
22 resource_size_t offset)
22{ 23{
23 struct pci_bus_resource *bus_res; 24 struct pci_host_bridge_window *window;
24 25
25 bus_res = kzalloc(sizeof(struct pci_bus_resource), GFP_KERNEL); 26 window = kzalloc(sizeof(struct pci_host_bridge_window), GFP_KERNEL);
26 if (!bus_res) { 27 if (!window) {
27 printk(KERN_ERR "PCI: can't add bus resource %pR\n", res); 28 printk(KERN_ERR "PCI: can't add host bridge window %pR\n", res);
28 return; 29 return;
29 } 30 }
30 31
31 bus_res->res = res; 32 window->res = res;
32 list_add_tail(&bus_res->list, resources); 33 window->offset = offset;
34 list_add_tail(&window->list, resources);
35}
36EXPORT_SYMBOL(pci_add_resource_offset);
37
38void pci_add_resource(struct list_head *resources, struct resource *res)
39{
40 pci_add_resource_offset(resources, res, 0);
33} 41}
34EXPORT_SYMBOL(pci_add_resource); 42EXPORT_SYMBOL(pci_add_resource);
35 43
36void pci_free_resource_list(struct list_head *resources) 44void pci_free_resource_list(struct list_head *resources)
37{ 45{
38 struct pci_bus_resource *bus_res, *tmp; 46 struct pci_host_bridge_window *window, *tmp;
39 47
40 list_for_each_entry_safe(bus_res, tmp, resources, list) { 48 list_for_each_entry_safe(window, tmp, resources, list) {
41 list_del(&bus_res->list); 49 list_del(&window->list);
42 kfree(bus_res); 50 kfree(window);
43 } 51 }
44} 52}
45EXPORT_SYMBOL(pci_free_resource_list); 53EXPORT_SYMBOL(pci_free_resource_list);