diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2015-10-14 02:29:38 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-16 16:18:51 -0400 |
commit | 3f7abdefc07755d67e2b2b63608d3128f6e0b3c5 (patch) | |
tree | 1bdf8c2558dec27d1a1a430899799b11e5527c5a | |
parent | 3772aea7d6f36cfa1dae17f04ffed64b4d747aab (diff) |
ia64/PCI: Use common struct resource_entry to replace struct iospace_resource
Use common struct resource_entry to replace private
struct iospace_resource.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | arch/ia64/include/asm/pci.h | 5 | ||||
-rw-r--r-- | arch/ia64/pci/pci.c | 17 |
2 files changed, 8 insertions, 14 deletions
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h index 36d2c1e3928b..07039d168f37 100644 --- a/arch/ia64/include/asm/pci.h +++ b/arch/ia64/include/asm/pci.h | |||
@@ -64,11 +64,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus, | |||
64 | #define pci_legacy_read platform_pci_legacy_read | 64 | #define pci_legacy_read platform_pci_legacy_read |
65 | #define pci_legacy_write platform_pci_legacy_write | 65 | #define pci_legacy_write platform_pci_legacy_write |
66 | 66 | ||
67 | struct iospace_resource { | ||
68 | struct list_head list; | ||
69 | struct resource res; | ||
70 | }; | ||
71 | |||
72 | struct pci_controller { | 67 | struct pci_controller { |
73 | struct acpi_device *companion; | 68 | struct acpi_device *companion; |
74 | void *iommu; | 69 | void *iommu; |
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index d20db9e48014..b1846b891ea5 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -154,14 +154,14 @@ new_space (u64 phys_base, int sparse) | |||
154 | static int add_io_space(struct device *dev, struct pci_root_info *info, | 154 | static int add_io_space(struct device *dev, struct pci_root_info *info, |
155 | struct resource_entry *entry) | 155 | struct resource_entry *entry) |
156 | { | 156 | { |
157 | struct iospace_resource *iospace; | 157 | struct resource_entry *iospace; |
158 | struct resource *resource, *res = entry->res; | 158 | struct resource *resource, *res = entry->res; |
159 | char *name; | 159 | char *name; |
160 | unsigned long base, min, max, base_port; | 160 | unsigned long base, min, max, base_port; |
161 | unsigned int sparse = 0, space_nr, len; | 161 | unsigned int sparse = 0, space_nr, len; |
162 | 162 | ||
163 | len = strlen(info->name) + 32; | 163 | len = strlen(info->name) + 32; |
164 | iospace = kzalloc(sizeof(*iospace) + len, GFP_KERNEL); | 164 | iospace = resource_list_create_entry(NULL, len); |
165 | if (!iospace) { | 165 | if (!iospace) { |
166 | dev_err(dev, "PCI: No memory for %s I/O port space\n", | 166 | dev_err(dev, "PCI: No memory for %s I/O port space\n", |
167 | info->name); | 167 | info->name); |
@@ -190,7 +190,7 @@ static int add_io_space(struct device *dev, struct pci_root_info *info, | |||
190 | if (space_nr == 0) | 190 | if (space_nr == 0) |
191 | sparse = 1; | 191 | sparse = 1; |
192 | 192 | ||
193 | resource = &iospace->res; | 193 | resource = iospace->res; |
194 | resource->name = name; | 194 | resource->name = name; |
195 | resource->flags = IORESOURCE_MEM; | 195 | resource->flags = IORESOURCE_MEM; |
196 | resource->start = base + (sparse ? IO_SPACE_SPARSE_ENCODING(min) : min); | 196 | resource->start = base + (sparse ? IO_SPACE_SPARSE_ENCODING(min) : min); |
@@ -205,12 +205,12 @@ static int add_io_space(struct device *dev, struct pci_root_info *info, | |||
205 | entry->offset = base_port; | 205 | entry->offset = base_port; |
206 | res->start = min + base_port; | 206 | res->start = min + base_port; |
207 | res->end = max + base_port; | 207 | res->end = max + base_port; |
208 | list_add_tail(&iospace->list, &info->io_resources); | 208 | resource_list_add_tail(iospace, &info->io_resources); |
209 | 209 | ||
210 | return 0; | 210 | return 0; |
211 | 211 | ||
212 | free_resource: | 212 | free_resource: |
213 | kfree(iospace); | 213 | resource_list_free_entry(iospace); |
214 | return -ENOSPC; | 214 | return -ENOSPC; |
215 | } | 215 | } |
216 | 216 | ||
@@ -369,12 +369,11 @@ static void add_resources(struct pci_root_info *info, struct device *dev) | |||
369 | static void __release_pci_root_info(struct pci_root_info *info) | 369 | static void __release_pci_root_info(struct pci_root_info *info) |
370 | { | 370 | { |
371 | struct resource *res; | 371 | struct resource *res; |
372 | struct iospace_resource *iospace, *tmp; | ||
373 | struct resource_entry *entry, *tentry; | 372 | struct resource_entry *entry, *tentry; |
374 | 373 | ||
375 | list_for_each_entry_safe(iospace, tmp, &info->io_resources, list) { | 374 | resource_list_for_each_entry_safe(entry, tentry, &info->io_resources) { |
376 | release_resource(&iospace->res); | 375 | release_resource(entry->res); |
377 | kfree(iospace); | 376 | resource_list_destroy_entry(entry); |
378 | } | 377 | } |
379 | 378 | ||
380 | resource_list_for_each_entry_safe(entry, tentry, &info->resources) { | 379 | resource_list_for_each_entry_safe(entry, tentry, &info->resources) { |