diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-02-23 22:19:04 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-02-23 22:19:04 -0500 |
commit | fb127cb9de791d62fb393d6e65fa9869bddd2460 (patch) | |
tree | 5cb45ac2fd5139cfc9165fead210a3ad2bb3b2a5 | |
parent | 4ba2aef3157f483fd67ac2616f14dbc32a3f751d (diff) |
PCI: collapse pcibios_resource_to_bus
Everybody uses the generic pcibios_resource_to_bus() supplied by the core
now, so remove the ARCH_HAS_GENERIC_PCI_OFFSETS used during conversion.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | arch/alpha/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/ia64/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/microblaze/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/mn10300/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/parisc/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/sh/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/pci_32.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/pci_64.h | 2 | ||||
-rw-r--r-- | drivers/pci/probe.c | 44 | ||||
-rw-r--r-- | include/asm-generic/pci.h | 2 |
13 files changed, 15 insertions, 53 deletions
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h index 121c797eb14f..d01afb78919c 100644 --- a/arch/alpha/include/asm/pci.h +++ b/arch/alpha/include/asm/pci.h | |||
@@ -100,8 +100,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | |||
100 | return channel ? 15 : 14; | 100 | return channel ? 15 : 14; |
101 | } | 101 | } |
102 | 102 | ||
103 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
104 | |||
105 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index | 103 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index |
106 | 104 | ||
107 | static inline int pci_proc_domain(struct pci_bus *bus) | 105 | static inline int pci_proc_domain(struct pci_bus *bus) |
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h index 4748a75ed112..a98a2e112fae 100644 --- a/arch/arm/include/asm/pci.h +++ b/arch/arm/include/asm/pci.h | |||
@@ -57,8 +57,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
57 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | 57 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, |
58 | enum pci_mmap_state mmap_state, int write_combine); | 58 | enum pci_mmap_state mmap_state, int write_combine); |
59 | 59 | ||
60 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
61 | |||
62 | /* | 60 | /* |
63 | * Dummy implementation; always return 0. | 61 | * Dummy implementation; always return 0. |
64 | */ | 62 | */ |
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h index 519bb5ce3075..b22e5f5fa593 100644 --- a/arch/ia64/include/asm/pci.h +++ b/arch/ia64/include/asm/pci.h | |||
@@ -108,8 +108,6 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
108 | return (pci_domain_nr(bus) != 0); | 108 | return (pci_domain_nr(bus) != 0); |
109 | } | 109 | } |
110 | 110 | ||
111 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
112 | |||
113 | static inline struct resource * | 111 | static inline struct resource * |
114 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | 112 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) |
115 | { | 113 | { |
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h index 8db01f705b3c..a0da88bf70c5 100644 --- a/arch/microblaze/include/asm/pci.h +++ b/arch/microblaze/include/asm/pci.h | |||
@@ -94,8 +94,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus, | |||
94 | */ | 94 | */ |
95 | #define PCI_DMA_BUS_IS_PHYS (1) | 95 | #define PCI_DMA_BUS_IS_PHYS (1) |
96 | 96 | ||
97 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
98 | |||
99 | static inline struct resource *pcibios_select_root(struct pci_dev *pdev, | 97 | static inline struct resource *pcibios_select_root(struct pci_dev *pdev, |
100 | struct resource *res) | 98 | struct resource *res) |
101 | { | 99 | { |
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index 6420e8df4e45..fcd4060f6421 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h | |||
@@ -113,8 +113,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
113 | } | 113 | } |
114 | #endif | 114 | #endif |
115 | 115 | ||
116 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
117 | |||
118 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index | 116 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index |
119 | 117 | ||
120 | static inline int pci_proc_domain(struct pci_bus *bus) | 118 | static inline int pci_proc_domain(struct pci_bus *bus) |
diff --git a/arch/mn10300/include/asm/pci.h b/arch/mn10300/include/asm/pci.h index dfe1581c0c9d..8137c25c4e15 100644 --- a/arch/mn10300/include/asm/pci.h +++ b/arch/mn10300/include/asm/pci.h | |||
@@ -85,8 +85,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
85 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ | 85 | /* implement the pci_ DMA API in terms of the generic device dma_ one */ |
86 | #include <asm-generic/pci-dma-compat.h> | 86 | #include <asm-generic/pci-dma-compat.h> |
87 | 87 | ||
88 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
89 | |||
90 | static inline struct resource * | 88 | static inline struct resource * |
91 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | 89 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) |
92 | { | 90 | { |
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h index a8b591fdd564..3234f492d575 100644 --- a/arch/parisc/include/asm/pci.h +++ b/arch/parisc/include/asm/pci.h | |||
@@ -215,8 +215,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
215 | } | 215 | } |
216 | #endif | 216 | #endif |
217 | 217 | ||
218 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
219 | |||
220 | static inline void pcibios_penalize_isa_irq(int irq, int active) | 218 | static inline void pcibios_penalize_isa_irq(int irq, int active) |
221 | { | 219 | { |
222 | /* We don't need to penalize isa irq's */ | 220 | /* We don't need to penalize isa irq's */ |
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h index 839178bf2776..201e352d488d 100644 --- a/arch/powerpc/include/asm/pci.h +++ b/arch/powerpc/include/asm/pci.h | |||
@@ -154,8 +154,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus, | |||
154 | 154 | ||
155 | #endif /* CONFIG_PPC64 */ | 155 | #endif /* CONFIG_PPC64 */ |
156 | 156 | ||
157 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
158 | |||
159 | extern void pcibios_claim_one_bus(struct pci_bus *b); | 157 | extern void pcibios_claim_one_bus(struct pci_bus *b); |
160 | 158 | ||
161 | extern void pcibios_finish_adding_to_bus(struct pci_bus *bus); | 159 | extern void pcibios_finish_adding_to_bus(struct pci_bus *bus); |
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h index 3b5b6abb3aea..bff96c2e7d25 100644 --- a/arch/sh/include/asm/pci.h +++ b/arch/sh/include/asm/pci.h | |||
@@ -114,8 +114,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
114 | /* Board-specific fixup routines. */ | 114 | /* Board-specific fixup routines. */ |
115 | int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin); | 115 | int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin); |
116 | 116 | ||
117 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
118 | |||
119 | #define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index | 117 | #define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index |
120 | 118 | ||
121 | static inline int pci_proc_domain(struct pci_bus *bus) | 119 | static inline int pci_proc_domain(struct pci_bus *bus) |
diff --git a/arch/sparc/include/asm/pci_32.h b/arch/sparc/include/asm/pci_32.h index 6384f30429bb..dc503297481f 100644 --- a/arch/sparc/include/asm/pci_32.h +++ b/arch/sparc/include/asm/pci_32.h | |||
@@ -52,8 +52,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
52 | * 64Kbytes by the Host controller. | 52 | * 64Kbytes by the Host controller. |
53 | */ | 53 | */ |
54 | 54 | ||
55 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
56 | |||
57 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | 55 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) |
58 | { | 56 | { |
59 | return PCI_IRQ_NONE; | 57 | return PCI_IRQ_NONE; |
diff --git a/arch/sparc/include/asm/pci_64.h b/arch/sparc/include/asm/pci_64.h index 2918bd12c19b..1633b718d3bc 100644 --- a/arch/sparc/include/asm/pci_64.h +++ b/arch/sparc/include/asm/pci_64.h | |||
@@ -73,8 +73,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
73 | enum pci_mmap_state mmap_state, | 73 | enum pci_mmap_state mmap_state, |
74 | int write_combine); | 74 | int write_combine); |
75 | 75 | ||
76 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
77 | |||
78 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | 76 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) |
79 | { | 77 | { |
80 | return PCI_IRQ_NONE; | 78 | return PCI_IRQ_NONE; |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index a677b1e995de..36c22032ea14 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -66,8 +66,8 @@ static bool resource_contains(struct resource *res1, struct resource *res2) | |||
66 | return res1->start <= res2->start && res1->end >= res2->end; | 66 | return res1->start <= res2->start && res1->end >= res2->end; |
67 | } | 67 | } |
68 | 68 | ||
69 | void pci_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 69 | void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
70 | struct resource *res) | 70 | struct resource *res) |
71 | { | 71 | { |
72 | struct pci_host_bridge *bridge = pci_host_bridge(dev); | 72 | struct pci_host_bridge *bridge = pci_host_bridge(dev); |
73 | struct pci_host_bridge_window *window; | 73 | struct pci_host_bridge_window *window; |
@@ -86,6 +86,7 @@ void pci_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
86 | region->start = res->start - offset; | 86 | region->start = res->start - offset; |
87 | region->end = res->end - offset; | 87 | region->end = res->end - offset; |
88 | } | 88 | } |
89 | EXPORT_SYMBOL(pcibios_resource_to_bus); | ||
89 | 90 | ||
90 | static bool region_contains(struct pci_bus_region *region1, | 91 | static bool region_contains(struct pci_bus_region *region1, |
91 | struct pci_bus_region *region2) | 92 | struct pci_bus_region *region2) |
@@ -93,8 +94,8 @@ static bool region_contains(struct pci_bus_region *region1, | |||
93 | return region1->start <= region2->start && region1->end >= region2->end; | 94 | return region1->start <= region2->start && region1->end >= region2->end; |
94 | } | 95 | } |
95 | 96 | ||
96 | void pci_bus_to_resource(struct pci_dev *dev, struct resource *res, | 97 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, |
97 | struct pci_bus_region *region) | 98 | struct pci_bus_region *region) |
98 | { | 99 | { |
99 | struct pci_host_bridge *bridge = pci_host_bridge(dev); | 100 | struct pci_host_bridge *bridge = pci_host_bridge(dev); |
100 | struct pci_host_bridge_window *window; | 101 | struct pci_host_bridge_window *window; |
@@ -117,22 +118,7 @@ void pci_bus_to_resource(struct pci_dev *dev, struct resource *res, | |||
117 | res->start = region->start + offset; | 118 | res->start = region->start + offset; |
118 | res->end = region->end + offset; | 119 | res->end = region->end + offset; |
119 | } | 120 | } |
120 | |||
121 | #ifdef ARCH_HAS_GENERIC_PCI_OFFSETS | ||
122 | void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | ||
123 | struct resource *res) | ||
124 | { | ||
125 | pci_resource_to_bus(dev, region, res); | ||
126 | } | ||
127 | EXPORT_SYMBOL(pcibios_resource_to_bus); | ||
128 | |||
129 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
130 | struct pci_bus_region *region) | ||
131 | { | ||
132 | pci_bus_to_resource(dev, res, region); | ||
133 | } | ||
134 | EXPORT_SYMBOL(pcibios_bus_to_resource); | 121 | EXPORT_SYMBOL(pcibios_bus_to_resource); |
135 | #endif | ||
136 | 122 | ||
137 | /* | 123 | /* |
138 | * PCI Bus Class | 124 | * PCI Bus Class |
@@ -309,11 +295,11 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
309 | pci_write_config_dword(dev, pos + 4, 0); | 295 | pci_write_config_dword(dev, pos + 4, 0); |
310 | region.start = 0; | 296 | region.start = 0; |
311 | region.end = sz64; | 297 | region.end = sz64; |
312 | pci_bus_to_resource(dev, res, ®ion); | 298 | pcibios_bus_to_resource(dev, res, ®ion); |
313 | } else { | 299 | } else { |
314 | region.start = l64; | 300 | region.start = l64; |
315 | region.end = l64 + sz64; | 301 | region.end = l64 + sz64; |
316 | pci_bus_to_resource(dev, res, ®ion); | 302 | pcibios_bus_to_resource(dev, res, ®ion); |
317 | dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", | 303 | dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", |
318 | pos, res); | 304 | pos, res); |
319 | } | 305 | } |
@@ -325,7 +311,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
325 | 311 | ||
326 | region.start = l; | 312 | region.start = l; |
327 | region.end = l + sz; | 313 | region.end = l + sz; |
328 | pci_bus_to_resource(dev, res, ®ion); | 314 | pcibios_bus_to_resource(dev, res, ®ion); |
329 | 315 | ||
330 | dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res); | 316 | dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res); |
331 | } | 317 | } |
@@ -383,7 +369,7 @@ static void __devinit pci_read_bridge_io(struct pci_bus *child) | |||
383 | res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO; | 369 | res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO; |
384 | region.start = base; | 370 | region.start = base; |
385 | region.end = limit + 0xfff; | 371 | region.end = limit + 0xfff; |
386 | pci_bus_to_resource(dev, &res2, ®ion); | 372 | pcibios_bus_to_resource(dev, &res2, ®ion); |
387 | if (!res->start) | 373 | if (!res->start) |
388 | res->start = res2.start; | 374 | res->start = res2.start; |
389 | if (!res->end) | 375 | if (!res->end) |
@@ -409,7 +395,7 @@ static void __devinit pci_read_bridge_mmio(struct pci_bus *child) | |||
409 | res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM; | 395 | res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM; |
410 | region.start = base; | 396 | region.start = base; |
411 | region.end = limit + 0xfffff; | 397 | region.end = limit + 0xfffff; |
412 | pci_bus_to_resource(dev, res, ®ion); | 398 | pcibios_bus_to_resource(dev, res, ®ion); |
413 | dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); | 399 | dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); |
414 | } | 400 | } |
415 | } | 401 | } |
@@ -458,7 +444,7 @@ static void __devinit pci_read_bridge_mmio_pref(struct pci_bus *child) | |||
458 | res->flags |= IORESOURCE_MEM_64; | 444 | res->flags |= IORESOURCE_MEM_64; |
459 | region.start = base; | 445 | region.start = base; |
460 | region.end = limit + 0xfffff; | 446 | region.end = limit + 0xfffff; |
461 | pci_bus_to_resource(dev, res, ®ion); | 447 | pcibios_bus_to_resource(dev, res, ®ion); |
462 | dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); | 448 | dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); |
463 | } | 449 | } |
464 | } | 450 | } |
@@ -1071,24 +1057,24 @@ int pci_setup_device(struct pci_dev *dev) | |||
1071 | region.end = 0x1F7; | 1057 | region.end = 0x1F7; |
1072 | res = &dev->resource[0]; | 1058 | res = &dev->resource[0]; |
1073 | res->flags = LEGACY_IO_RESOURCE; | 1059 | res->flags = LEGACY_IO_RESOURCE; |
1074 | pci_bus_to_resource(dev, res, ®ion); | 1060 | pcibios_bus_to_resource(dev, res, ®ion); |
1075 | region.start = 0x3F6; | 1061 | region.start = 0x3F6; |
1076 | region.end = 0x3F6; | 1062 | region.end = 0x3F6; |
1077 | res = &dev->resource[1]; | 1063 | res = &dev->resource[1]; |
1078 | res->flags = LEGACY_IO_RESOURCE; | 1064 | res->flags = LEGACY_IO_RESOURCE; |
1079 | pci_bus_to_resource(dev, res, ®ion); | 1065 | pcibios_bus_to_resource(dev, res, ®ion); |
1080 | } | 1066 | } |
1081 | if ((progif & 4) == 0) { | 1067 | if ((progif & 4) == 0) { |
1082 | region.start = 0x170; | 1068 | region.start = 0x170; |
1083 | region.end = 0x177; | 1069 | region.end = 0x177; |
1084 | res = &dev->resource[2]; | 1070 | res = &dev->resource[2]; |
1085 | res->flags = LEGACY_IO_RESOURCE; | 1071 | res->flags = LEGACY_IO_RESOURCE; |
1086 | pci_bus_to_resource(dev, res, ®ion); | 1072 | pcibios_bus_to_resource(dev, res, ®ion); |
1087 | region.start = 0x376; | 1073 | region.start = 0x376; |
1088 | region.end = 0x376; | 1074 | region.end = 0x376; |
1089 | res = &dev->resource[3]; | 1075 | res = &dev->resource[3]; |
1090 | res->flags = LEGACY_IO_RESOURCE; | 1076 | res->flags = LEGACY_IO_RESOURCE; |
1091 | pci_bus_to_resource(dev, res, ®ion); | 1077 | pcibios_bus_to_resource(dev, res, ®ion); |
1092 | } | 1078 | } |
1093 | } | 1079 | } |
1094 | break; | 1080 | break; |
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h index 0410346e2cf6..e80a0495e5b0 100644 --- a/include/asm-generic/pci.h +++ b/include/asm-generic/pci.h | |||
@@ -6,8 +6,6 @@ | |||
6 | #ifndef _ASM_GENERIC_PCI_H | 6 | #ifndef _ASM_GENERIC_PCI_H |
7 | #define _ASM_GENERIC_PCI_H | 7 | #define _ASM_GENERIC_PCI_H |
8 | 8 | ||
9 | #define ARCH_HAS_GENERIC_PCI_OFFSETS | ||
10 | |||
11 | static inline struct resource * | 9 | static inline struct resource * |
12 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | 10 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) |
13 | { | 11 | { |