kernel: update 3.10 to 3.10.32
[openwrt/svn-archive/archive.git] / target / linux / mvebu / patches-3.10 / 0183-of-irq-Rename-of_irq_map_-functions-to-of_irq_parse_.patch
1 From fd33285b3dab183df0cea06de9f618886dc0f1c0 Mon Sep 17 00:00:00 2001
2 From: Grant Likely <grant.likely@linaro.org>
3 Date: Thu, 19 Dec 2013 09:30:54 -0300
4 Subject: [PATCH 183/203] of/irq: Rename of_irq_map_* functions to
5 of_irq_parse_*
6
7 The OF irq handling code has been overloading the term 'map' to refer to
8 both parsing the data in the device tree and mapping it to the internal
9 linux irq system. This is probably because the device tree does have the
10 concept of an 'interrupt-map' function for translating interrupt
11 references from one node to another, but 'map' is still confusing when
12 the primary purpose of some of the functions are to parse the DT data.
13
14 This patch renames all the of_irq_map_* functions to of_irq_parse_*
15 which makes it clear that there is a difference between the parsing
16 phase and the mapping phase. Kernel code can make use of just the
17 parsing or just the mapping support as needed by the subsystem.
18
19 The patch was generated mechanically with a handful of sed commands.
20
21 Signed-off-by: Grant Likely <grant.likely@linaro.org>
22 Acked-by: Michal Simek <monstr@monstr.eu>
23 Acked-by: Tony Lindgren <tony@atomide.com>
24 Cc: Ralf Baechle <ralf@linux-mips.org>
25 Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
26
27 Conflicts:
28 arch/arm/mach-integrator/pci_v3.c
29 arch/mips/pci/pci-rt3883.c
30 ---
31 arch/arm/mach-integrator/pci_v3.c | 279 +++++++++++++++++++++++++
32 arch/microblaze/pci/pci-common.c | 2 +-
33 arch/mips/pci/fixup-lantiq.c | 2 +-
34 arch/powerpc/kernel/pci-common.c | 2 +-
35 arch/powerpc/platforms/cell/celleb_scc_pciex.c | 2 +-
36 arch/powerpc/platforms/cell/celleb_scc_sio.c | 2 +-
37 arch/powerpc/platforms/cell/spider-pic.c | 2 +-
38 arch/powerpc/platforms/cell/spu_manage.c | 2 +-
39 arch/powerpc/platforms/fsl_uli1575.c | 2 +-
40 arch/powerpc/platforms/powermac/pic.c | 2 +-
41 arch/powerpc/platforms/pseries/event_sources.c | 2 +-
42 arch/powerpc/sysdev/mpic_msi.c | 2 +-
43 arch/x86/kernel/devicetree.c | 2 +-
44 drivers/of/address.c | 4 +-
45 drivers/of/irq.c | 28 +--
46 drivers/of/of_pci_irq.c | 10 +-
47 drivers/pci/host/pci-mvebu.c | 2 +-
48 include/linux/of_irq.h | 8 +-
49 include/linux/of_pci.h | 2 +-
50 19 files changed, 318 insertions(+), 39 deletions(-)
51
52 --- a/arch/arm/mach-integrator/pci_v3.c
53 +++ b/arch/arm/mach-integrator/pci_v3.c
54 @@ -610,3 +610,282 @@ void __init pci_v3_postinit(void)
55
56 register_isa_ports(PHYS_PCI_MEM_BASE, PHYS_PCI_IO_BASE, 0);
57 }
58 +
59 +/*
60 + * A small note about bridges and interrupts. The DECchip 21050 (and
61 + * later) adheres to the PCI-PCI bridge specification. This says that
62 + * the interrupts on the other side of a bridge are swizzled in the
63 + * following manner:
64 + *
65 + * Dev Interrupt Interrupt
66 + * Pin on Pin on
67 + * Device Connector
68 + *
69 + * 4 A A
70 + * B B
71 + * C C
72 + * D D
73 + *
74 + * 5 A B
75 + * B C
76 + * C D
77 + * D A
78 + *
79 + * 6 A C
80 + * B D
81 + * C A
82 + * D B
83 + *
84 + * 7 A D
85 + * B A
86 + * C B
87 + * D C
88 + *
89 + * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A.
90 + * Thus, each swizzle is ((pin-1) + (device#-4)) % 4
91 + */
92 +
93 +/*
94 + * This routine handles multiple bridges.
95 + */
96 +static u8 __init pci_v3_swizzle(struct pci_dev *dev, u8 *pinp)
97 +{
98 + if (*pinp == 0)
99 + *pinp = 1;
100 +
101 + return pci_common_swizzle(dev, pinp);
102 +}
103 +
104 +static int irq_tab[4] __initdata = {
105 + IRQ_AP_PCIINT0, IRQ_AP_PCIINT1, IRQ_AP_PCIINT2, IRQ_AP_PCIINT3
106 +};
107 +
108 +/*
109 + * map the specified device/slot/pin to an IRQ. This works out such
110 + * that slot 9 pin 1 is INT0, pin 2 is INT1, and slot 10 pin 1 is INT1.
111 + */
112 +static int __init pci_v3_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
113 +{
114 + int intnr = ((slot - 9) + (pin - 1)) & 3;
115 +
116 + return irq_tab[intnr];
117 +}
118 +
119 +static struct hw_pci pci_v3 __initdata = {
120 + .swizzle = pci_v3_swizzle,
121 + .setup = pci_v3_setup,
122 + .nr_controllers = 1,
123 + .ops = &pci_v3_ops,
124 + .preinit = pci_v3_preinit,
125 + .postinit = pci_v3_postinit,
126 +};
127 +
128 +#ifdef CONFIG_OF
129 +
130 +static int __init pci_v3_map_irq_dt(const struct pci_dev *dev, u8 slot, u8 pin)
131 +{
132 + struct of_irq oirq;
133 + int ret;
134 +
135 + ret = of_irq_parse_pci(dev, &oirq);
136 + if (ret) {
137 + dev_err(&dev->dev, "of_irq_parse_pci() %d\n", ret);
138 + /* Proper return code 0 == NO_IRQ */
139 + return 0;
140 + }
141 +
142 + return irq_create_of_mapping(oirq.controller, oirq.specifier,
143 + oirq.size);
144 +}
145 +
146 +static int __init pci_v3_dtprobe(struct platform_device *pdev,
147 + struct device_node *np)
148 +{
149 + struct of_pci_range_parser parser;
150 + struct of_pci_range range;
151 + struct resource *res;
152 + int irq, ret;
153 +
154 + if (of_pci_range_parser_init(&parser, np))
155 + return -EINVAL;
156 +
157 + /* Get base for bridge registers */
158 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
159 + if (!res) {
160 + dev_err(&pdev->dev, "unable to obtain PCIv3 base\n");
161 + return -ENODEV;
162 + }
163 + pci_v3_base = devm_ioremap(&pdev->dev, res->start,
164 + resource_size(res));
165 + if (!pci_v3_base) {
166 + dev_err(&pdev->dev, "unable to remap PCIv3 base\n");
167 + return -ENODEV;
168 + }
169 +
170 + /* Get and request error IRQ resource */
171 + irq = platform_get_irq(pdev, 0);
172 + if (irq <= 0) {
173 + dev_err(&pdev->dev, "unable to obtain PCIv3 error IRQ\n");
174 + return -ENODEV;
175 + }
176 + ret = devm_request_irq(&pdev->dev, irq, v3_irq, 0,
177 + "PCIv3 error", NULL);
178 + if (ret < 0) {
179 + dev_err(&pdev->dev, "unable to request PCIv3 error IRQ %d (%d)\n", irq, ret);
180 + return ret;
181 + }
182 +
183 + for_each_of_pci_range(&parser, &range) {
184 + if (!range.flags) {
185 + of_pci_range_to_resource(&range, np, &conf_mem);
186 + conf_mem.name = "PCIv3 config";
187 + }
188 + if (range.flags & IORESOURCE_IO) {
189 + of_pci_range_to_resource(&range, np, &io_mem);
190 + io_mem.name = "PCIv3 I/O";
191 + }
192 + if ((range.flags & IORESOURCE_MEM) &&
193 + !(range.flags & IORESOURCE_PREFETCH)) {
194 + non_mem_pci = range.pci_addr;
195 + non_mem_pci_sz = range.size;
196 + of_pci_range_to_resource(&range, np, &non_mem);
197 + non_mem.name = "PCIv3 non-prefetched mem";
198 + }
199 + if ((range.flags & IORESOURCE_MEM) &&
200 + (range.flags & IORESOURCE_PREFETCH)) {
201 + pre_mem_pci = range.pci_addr;
202 + pre_mem_pci_sz = range.size;
203 + of_pci_range_to_resource(&range, np, &pre_mem);
204 + pre_mem.name = "PCIv3 prefetched mem";
205 + }
206 + }
207 +
208 + if (!conf_mem.start || !io_mem.start ||
209 + !non_mem.start || !pre_mem.start) {
210 + dev_err(&pdev->dev, "missing ranges in device node\n");
211 + return -EINVAL;
212 + }
213 +
214 + pci_v3.map_irq = pci_v3_map_irq_dt;
215 + pci_common_init_dev(&pdev->dev, &pci_v3);
216 +
217 + return 0;
218 +}
219 +
220 +#else
221 +
222 +static inline int pci_v3_dtprobe(struct platform_device *pdev,
223 + struct device_node *np)
224 +{
225 + return -EINVAL;
226 +}
227 +
228 +#endif
229 +
230 +static int __init pci_v3_probe(struct platform_device *pdev)
231 +{
232 + struct device_node *np = pdev->dev.of_node;
233 + int ret;
234 +
235 + /* Remap the Integrator system controller */
236 + ap_syscon_base = ioremap(INTEGRATOR_SC_BASE, 0x100);
237 + if (!ap_syscon_base) {
238 + dev_err(&pdev->dev, "unable to remap the AP syscon for PCIv3\n");
239 + return -ENODEV;
240 + }
241 +
242 + /* Device tree probe path */
243 + if (np)
244 + return pci_v3_dtprobe(pdev, np);
245 +
246 + pci_v3_base = devm_ioremap(&pdev->dev, PHYS_PCI_V3_BASE, SZ_64K);
247 + if (!pci_v3_base) {
248 + dev_err(&pdev->dev, "unable to remap PCIv3 base\n");
249 + return -ENODEV;
250 + }
251 +
252 + ret = devm_request_irq(&pdev->dev, IRQ_AP_V3INT, v3_irq, 0, "V3", NULL);
253 + if (ret) {
254 + dev_err(&pdev->dev, "unable to grab PCI error interrupt: %d\n",
255 + ret);
256 + return -ENODEV;
257 + }
258 +
259 + conf_mem.name = "PCIv3 config";
260 + conf_mem.start = PHYS_PCI_CONFIG_BASE;
261 + conf_mem.end = PHYS_PCI_CONFIG_BASE + SZ_16M - 1;
262 + conf_mem.flags = IORESOURCE_MEM;
263 +
264 + io_mem.name = "PCIv3 I/O";
265 + io_mem.start = PHYS_PCI_IO_BASE;
266 + io_mem.end = PHYS_PCI_IO_BASE + SZ_16M - 1;
267 + io_mem.flags = IORESOURCE_MEM;
268 +
269 + non_mem_pci = 0x00000000;
270 + non_mem_pci_sz = SZ_256M;
271 + non_mem.name = "PCIv3 non-prefetched mem";
272 + non_mem.start = PHYS_PCI_MEM_BASE;
273 + non_mem.end = PHYS_PCI_MEM_BASE + SZ_256M - 1;
274 + non_mem.flags = IORESOURCE_MEM;
275 +
276 + pre_mem_pci = 0x10000000;
277 + pre_mem_pci_sz = SZ_256M;
278 + pre_mem.name = "PCIv3 prefetched mem";
279 + pre_mem.start = PHYS_PCI_PRE_BASE + SZ_256M;
280 + pre_mem.end = PHYS_PCI_PRE_BASE + SZ_256M - 1;
281 + pre_mem.flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
282 +
283 + pci_v3.map_irq = pci_v3_map_irq;
284 +
285 + pci_common_init_dev(&pdev->dev, &pci_v3);
286 +
287 + return 0;
288 +}
289 +
290 +static const struct of_device_id pci_ids[] = {
291 + { .compatible = "v3,v360epc-pci", },
292 + {},
293 +};
294 +
295 +static struct platform_driver pci_v3_driver = {
296 + .driver = {
297 + .name = "pci-v3",
298 + .of_match_table = pci_ids,
299 + },
300 +};
301 +
302 +static int __init pci_v3_init(void)
303 +{
304 + return platform_driver_probe(&pci_v3_driver, pci_v3_probe);
305 +}
306 +
307 +subsys_initcall(pci_v3_init);
308 +
309 +/*
310 + * Static mappings for the PCIv3 bridge
311 + *
312 + * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M)
313 + * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M)
314 + * fee00000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M)
315 + */
316 +static struct map_desc pci_v3_io_desc[] __initdata __maybe_unused = {
317 + {
318 + .virtual = (unsigned long)PCI_MEMORY_VADDR,
319 + .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE),
320 + .length = SZ_16M,
321 + .type = MT_DEVICE
322 + }, {
323 + .virtual = (unsigned long)PCI_CONFIG_VADDR,
324 + .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE),
325 + .length = SZ_16M,
326 + .type = MT_DEVICE
327 + }
328 +};
329 +
330 +int __init pci_v3_early_init(void)
331 +{
332 + iotable_init(pci_v3_io_desc, ARRAY_SIZE(pci_v3_io_desc));
333 + vga_base = (unsigned long)PCI_MEMORY_VADDR;
334 + pci_map_io_early(__phys_to_pfn(PHYS_PCI_IO_BASE));
335 + return 0;
336 +}
337 --- a/arch/microblaze/pci/pci-common.c
338 +++ b/arch/microblaze/pci/pci-common.c
339 @@ -217,7 +217,7 @@ int pci_read_irq_line(struct pci_dev *pc
340 memset(&oirq, 0xff, sizeof(oirq));
341 #endif
342 /* Try to get a mapping from the device-tree */
343 - if (of_irq_map_pci(pci_dev, &oirq)) {
344 + if (of_irq_parse_pci(pci_dev, &oirq)) {
345 u8 line, pin;
346
347 /* If that fails, lets fallback to what is in the config
348 --- a/arch/mips/pci/fixup-lantiq.c
349 +++ b/arch/mips/pci/fixup-lantiq.c
350 @@ -28,7 +28,7 @@ int __init pcibios_map_irq(const struct
351 struct of_irq dev_irq;
352 int irq;
353
354 - if (of_irq_map_pci(dev, &dev_irq)) {
355 + if (of_irq_parse_pci(dev, &dev_irq)) {
356 dev_err(&dev->dev, "trying to map irq for unknown slot:%d pin:%d\n",
357 slot, pin);
358 return 0;
359 --- a/arch/powerpc/kernel/pci-common.c
360 +++ b/arch/powerpc/kernel/pci-common.c
361 @@ -237,7 +237,7 @@ static int pci_read_irq_line(struct pci_
362 memset(&oirq, 0xff, sizeof(oirq));
363 #endif
364 /* Try to get a mapping from the device-tree */
365 - if (of_irq_map_pci(pci_dev, &oirq)) {
366 + if (of_irq_parse_pci(pci_dev, &oirq)) {
367 u8 line, pin;
368
369 /* If that fails, lets fallback to what is in the config
370 --- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c
371 +++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
372 @@ -507,7 +507,7 @@ static __init int celleb_setup_pciex(str
373 phb->ops = &scc_pciex_pci_ops;
374
375 /* internal interrupt handler */
376 - if (of_irq_map_one(node, 1, &oirq)) {
377 + if (of_irq_parse_one(node, 1, &oirq)) {
378 pr_err("PCIEXC:Failed to map irq\n");
379 goto error;
380 }
381 --- a/arch/powerpc/platforms/cell/celleb_scc_sio.c
382 +++ b/arch/powerpc/platforms/cell/celleb_scc_sio.c
383 @@ -53,7 +53,7 @@ static int __init txx9_serial_init(void)
384 if (!(txx9_serial_bitmap & (1<<i)))
385 continue;
386
387 - if (of_irq_map_one(node, i, &irq))
388 + if (of_irq_parse_one(node, i, &irq))
389 continue;
390 if (of_address_to_resource(node,
391 txx9_scc_tab[i].index, &res))
392 --- a/arch/powerpc/platforms/cell/spider-pic.c
393 +++ b/arch/powerpc/platforms/cell/spider-pic.c
394 @@ -236,7 +236,7 @@ static unsigned int __init spider_find_c
395 * tree in case the device-tree is ever fixed
396 */
397 struct of_irq oirq;
398 - if (of_irq_map_one(pic->host->of_node, 0, &oirq) == 0) {
399 + if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0) {
400 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
401 oirq.size);
402 return virq;
403 --- a/arch/powerpc/platforms/cell/spu_manage.c
404 +++ b/arch/powerpc/platforms/cell/spu_manage.c
405 @@ -182,7 +182,7 @@ static int __init spu_map_interrupts(str
406 int i;
407
408 for (i=0; i < 3; i++) {
409 - ret = of_irq_map_one(np, i, &oirq);
410 + ret = of_irq_parse_one(np, i, &oirq);
411 if (ret) {
412 pr_debug("spu_new: failed to get irq %d\n", i);
413 goto err;
414 --- a/arch/powerpc/platforms/fsl_uli1575.c
415 +++ b/arch/powerpc/platforms/fsl_uli1575.c
416 @@ -333,7 +333,7 @@ static void hpcd_final_uli5288(struct pc
417
418 laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8);
419 laddr[1] = laddr[2] = 0;
420 - of_irq_map_raw(hosenode, &pin, 1, laddr, &oirq);
421 + of_irq_parse_raw(hosenode, &pin, 1, laddr, &oirq);
422 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
423 oirq.size);
424 dev->irq = virq;
425 --- a/arch/powerpc/platforms/powermac/pic.c
426 +++ b/arch/powerpc/platforms/powermac/pic.c
427 @@ -393,7 +393,7 @@ static void __init pmac_pic_probe_oldsty
428 #endif
429 }
430
431 -int of_irq_map_oldworld(struct device_node *device, int index,
432 +int of_irq_parse_oldworld(struct device_node *device, int index,
433 struct of_irq *out_irq)
434 {
435 const u32 *ints = NULL;
436 --- a/arch/powerpc/platforms/pseries/event_sources.c
437 +++ b/arch/powerpc/platforms/pseries/event_sources.c
438 @@ -55,7 +55,7 @@ void request_event_sources_irqs(struct d
439 /* Else use normal interrupt tree parsing */
440 else {
441 /* First try to do a proper OF tree parsing */
442 - for (index = 0; of_irq_map_one(np, index, &oirq) == 0;
443 + for (index = 0; of_irq_parse_one(np, index, &oirq) == 0;
444 index++) {
445 if (count > 15)
446 break;
447 --- a/arch/powerpc/sysdev/mpic_msi.c
448 +++ b/arch/powerpc/sysdev/mpic_msi.c
449 @@ -63,7 +63,7 @@ static int mpic_msi_reserve_u3_hwirqs(st
450 pr_debug("mpic: mapping hwirqs for %s\n", np->full_name);
451
452 index = 0;
453 - while (of_irq_map_one(np, index++, &oirq) == 0) {
454 + while (of_irq_parse_one(np, index++, &oirq) == 0) {
455 ops->xlate(mpic->irqhost, NULL, oirq.specifier,
456 oirq.size, &hwirq, &flags);
457 msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, hwirq);
458 --- a/arch/x86/kernel/devicetree.c
459 +++ b/arch/x86/kernel/devicetree.c
460 @@ -117,7 +117,7 @@ static int x86_of_pci_irq_enable(struct
461 if (!pin)
462 return 0;
463
464 - ret = of_irq_map_pci(dev, &oirq);
465 + ret = of_irq_parse_pci(dev, &oirq);
466 if (ret)
467 return ret;
468
469 --- a/drivers/of/address.c
470 +++ b/drivers/of/address.c
471 @@ -525,12 +525,12 @@ static u64 __of_translate_address(struct
472 pbus->count_cells(dev, &pna, &pns);
473 if (!OF_CHECK_COUNTS(pna, pns)) {
474 printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
475 - dev->full_name);
476 + of_node_full_name(dev));
477 break;
478 }
479
480 pr_debug("OF: parent bus is %s (na=%d, ns=%d) on %s\n",
481 - pbus->name, pna, pns, parent->full_name);
482 + pbus->name, pna, pns, of_node_full_name(parent));
483
484 /* Apply bus translation */
485 if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop))
486 --- a/drivers/of/irq.c
487 +++ b/drivers/of/irq.c
488 @@ -31,14 +31,14 @@
489 * @dev: Device node of the device whose interrupt is to be mapped
490 * @index: Index of the interrupt to map
491 *
492 - * This function is a wrapper that chains of_irq_map_one() and
493 + * This function is a wrapper that chains of_irq_parse_one() and
494 * irq_create_of_mapping() to make things easier to callers
495 */
496 unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
497 {
498 struct of_irq oirq;
499
500 - if (of_irq_map_one(dev, index, &oirq))
501 + if (of_irq_parse_one(dev, index, &oirq))
502 return 0;
503
504 return irq_create_of_mapping(oirq.controller, oirq.specifier,
505 @@ -79,7 +79,7 @@ struct device_node *of_irq_find_parent(s
506 }
507
508 /**
509 - * of_irq_map_raw - Low level interrupt tree parsing
510 + * of_irq_parse_raw - Low level interrupt tree parsing
511 * @parent: the device interrupt parent
512 * @intspec: interrupt specifier ("interrupts" property of the device)
513 * @ointsize: size of the passed in interrupt specifier
514 @@ -93,7 +93,7 @@ struct device_node *of_irq_find_parent(s
515 * properties, for example when resolving PCI interrupts when no device
516 * node exist for the parent.
517 */
518 -int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
519 +int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec,
520 u32 ointsize, const __be32 *addr, struct of_irq *out_irq)
521 {
522 struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
523 @@ -101,7 +101,7 @@ int of_irq_map_raw(struct device_node *p
524 u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
525 int imaplen, match, i;
526
527 - pr_debug("of_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
528 + pr_debug("of_irq_parse_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
529 of_node_full_name(parent), be32_to_cpup(intspec),
530 be32_to_cpup(intspec + 1), ointsize);
531
532 @@ -126,7 +126,7 @@ int of_irq_map_raw(struct device_node *p
533 goto fail;
534 }
535
536 - pr_debug("of_irq_map_raw: ipar=%s, size=%d\n", of_node_full_name(ipar), intsize);
537 + pr_debug("of_irq_parse_raw: ipar=%s, size=%d\n", of_node_full_name(ipar), intsize);
538
539 if (ointsize != intsize)
540 return -EINVAL;
541 @@ -269,29 +269,29 @@ int of_irq_map_raw(struct device_node *p
542
543 return -EINVAL;
544 }
545 -EXPORT_SYMBOL_GPL(of_irq_map_raw);
546 +EXPORT_SYMBOL_GPL(of_irq_parse_raw);
547
548 /**
549 - * of_irq_map_one - Resolve an interrupt for a device
550 + * of_irq_parse_one - Resolve an interrupt for a device
551 * @device: the device whose interrupt is to be resolved
552 * @index: index of the interrupt to resolve
553 * @out_irq: structure of_irq filled by this function
554 *
555 * This function resolves an interrupt, walking the tree, for a given
556 - * device-tree node. It's the high level pendant to of_irq_map_raw().
557 + * device-tree node. It's the high level pendant to of_irq_parse_raw().
558 */
559 -int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq)
560 +int of_irq_parse_one(struct device_node *device, int index, struct of_irq *out_irq)
561 {
562 struct device_node *p;
563 const __be32 *intspec, *tmp, *addr;
564 u32 intsize, intlen;
565 int res = -EINVAL;
566
567 - pr_debug("of_irq_map_one: dev=%s, index=%d\n", of_node_full_name(device), index);
568 + pr_debug("of_irq_parse_one: dev=%s, index=%d\n", of_node_full_name(device), index);
569
570 /* OldWorld mac stuff is "special", handle out of line */
571 if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
572 - return of_irq_map_oldworld(device, index, out_irq);
573 + return of_irq_parse_oldworld(device, index, out_irq);
574
575 /* Get the reg property (if any) */
576 addr = of_get_property(device, "reg", NULL);
577 @@ -328,13 +328,13 @@ int of_irq_map_one(struct device_node *d
578 goto out;
579
580 /* Get new specifier and map it */
581 - res = of_irq_map_raw(p, intspec + index * intsize, intsize,
582 + res = of_irq_parse_raw(p, intspec + index * intsize, intsize,
583 addr, out_irq);
584 out:
585 of_node_put(p);
586 return res;
587 }
588 -EXPORT_SYMBOL_GPL(of_irq_map_one);
589 +EXPORT_SYMBOL_GPL(of_irq_parse_one);
590
591 /**
592 * of_irq_to_resource - Decode a node's IRQ and return it as a resource
593 --- a/drivers/of/of_pci_irq.c
594 +++ b/drivers/of/of_pci_irq.c
595 @@ -5,7 +5,7 @@
596 #include <asm/prom.h>
597
598 /**
599 - * of_irq_map_pci - Resolve the interrupt for a PCI device
600 + * of_irq_parse_pci - Resolve the interrupt for a PCI device
601 * @pdev: the device whose interrupt is to be resolved
602 * @out_irq: structure of_irq filled by this function
603 *
604 @@ -15,7 +15,7 @@
605 * PCI tree until an device-node is found, at which point it will finish
606 * resolving using the OF tree walking.
607 */
608 -int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq)
609 +int of_irq_parse_pci(const struct pci_dev *pdev, struct of_irq *out_irq)
610 {
611 struct device_node *dn, *ppnode;
612 struct pci_dev *ppdev;
613 @@ -30,7 +30,7 @@ int of_irq_map_pci(const struct pci_dev
614 */
615 dn = pci_device_to_OF_node(pdev);
616 if (dn) {
617 - rc = of_irq_map_one(dn, 0, out_irq);
618 + rc = of_irq_parse_one(dn, 0, out_irq);
619 if (!rc)
620 return rc;
621 }
622 @@ -88,6 +88,6 @@ int of_irq_map_pci(const struct pci_dev
623 lspec_be = cpu_to_be32(lspec);
624 laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8));
625 laddr[1] = laddr[2] = cpu_to_be32(0);
626 - return of_irq_map_raw(ppnode, &lspec_be, 1, laddr, out_irq);
627 + return of_irq_parse_raw(ppnode, &lspec_be, 1, laddr, out_irq);
628 }
629 -EXPORT_SYMBOL_GPL(of_irq_map_pci);
630 +EXPORT_SYMBOL_GPL(of_irq_parse_pci);
631 --- a/drivers/pci/host/pci-mvebu.c
632 +++ b/drivers/pci/host/pci-mvebu.c
633 @@ -652,7 +652,7 @@ static int __init mvebu_pcie_map_irq(con
634 struct of_irq oirq;
635 int ret;
636
637 - ret = of_irq_map_pci(dev, &oirq);
638 + ret = of_irq_parse_pci(dev, &oirq);
639 if (ret)
640 return ret;
641
642 --- a/include/linux/of_irq.h
643 +++ b/include/linux/of_irq.h
644 @@ -35,12 +35,12 @@ typedef int (*of_irq_init_cb_t)(struct d
645 #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC)
646 extern unsigned int of_irq_workarounds;
647 extern struct device_node *of_irq_dflt_pic;
648 -extern int of_irq_map_oldworld(struct device_node *device, int index,
649 +extern int of_irq_parse_oldworld(struct device_node *device, int index,
650 struct of_irq *out_irq);
651 #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */
652 #define of_irq_workarounds (0)
653 #define of_irq_dflt_pic (NULL)
654 -static inline int of_irq_map_oldworld(struct device_node *device, int index,
655 +static inline int of_irq_parse_oldworld(struct device_node *device, int index,
656 struct of_irq *out_irq)
657 {
658 return -EINVAL;
659 @@ -48,10 +48,10 @@ static inline int of_irq_map_oldworld(st
660 #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */
661
662
663 -extern int of_irq_map_raw(struct device_node *parent, const __be32 *intspec,
664 +extern int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec,
665 u32 ointsize, const __be32 *addr,
666 struct of_irq *out_irq);
667 -extern int of_irq_map_one(struct device_node *device, int index,
668 +extern int of_irq_parse_one(struct device_node *device, int index,
669 struct of_irq *out_irq);
670 extern unsigned int irq_create_of_mapping(struct device_node *controller,
671 const u32 *intspec,
672 --- a/include/linux/of_pci.h
673 +++ b/include/linux/of_pci.h
674 @@ -6,7 +6,7 @@
675
676 struct pci_dev;
677 struct of_irq;
678 -int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq);
679 +int of_irq_parse_pci(const struct pci_dev *pdev, struct of_irq *out_irq);
680
681 struct device_node;
682 struct device_node *of_pci_find_child_device(struct device_node *parent,