diff options
author | Grant Likely <grant.likely@linaro.org> | 2013-09-15 11:39:11 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@freescale.com> | 2014-05-16 04:19:12 -0400 |
commit | d6e82b145aec027e127aa36527ae98714dab38ef (patch) | |
tree | 31c19c56b0e9c49e6da4260a2ef2ded2c263768c | |
parent | efc5383516e7c4d9ddeebab3eb3601467d7eb8f8 (diff) |
ENGR00313685-2 of/irq: Replace of_irq with of_phandle_args
commit 530210c7814e83564c7ca7bca8192515042c0b63 upstream.
struct of_irq and struct of_phandle_args are exactly the same structure.
This patch makes the kernel use of_phandle_args everywhere. This in
itself isn't a big deal, but it makes some follow-on patches simpler.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Tony Lindgren <tony@atomide.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Conflicts:
arch/arm/mach-integrator/pci_v3.c
arch/mips/pci/pci-rt3883.c
include/linux/of_irq.h
-rw-r--r-- | arch/microblaze/pci/pci-common.c | 9 | ||||
-rw-r--r-- | arch/mips/pci/fixup-lantiq.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/celleb_scc_pciex.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/celleb_scc_sio.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spider-pic.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_manage.c | 12 | ||||
-rw-r--r-- | arch/powerpc/platforms/fsl_uli1575.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pic.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/event_sources.c | 7 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic_msi.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/devicetree.c | 5 | ||||
-rw-r--r-- | drivers/of/irq.c | 15 | ||||
-rw-r--r-- | drivers/of/of_pci_irq.c | 2 | ||||
-rw-r--r-- | drivers/pci/host/pci-mvebu.c | 5 | ||||
-rw-r--r-- | include/linux/of_irq.h | 25 | ||||
-rw-r--r-- | include/linux/of_pci.h | 4 |
17 files changed, 54 insertions, 82 deletions
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 1a5bc93ca940..355527c6b837 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
@@ -199,7 +199,7 @@ void pcibios_set_master(struct pci_dev *dev) | |||
199 | */ | 199 | */ |
200 | int pci_read_irq_line(struct pci_dev *pci_dev) | 200 | int pci_read_irq_line(struct pci_dev *pci_dev) |
201 | { | 201 | { |
202 | struct of_irq oirq; | 202 | struct of_phandle_args oirq; |
203 | unsigned int virq; | 203 | unsigned int virq; |
204 | 204 | ||
205 | /* The current device-tree that iSeries generates from the HV | 205 | /* The current device-tree that iSeries generates from the HV |
@@ -243,11 +243,10 @@ int pci_read_irq_line(struct pci_dev *pci_dev) | |||
243 | irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); | 243 | irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); |
244 | } else { | 244 | } else { |
245 | pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", | 245 | pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", |
246 | oirq.size, oirq.specifier[0], oirq.specifier[1], | 246 | oirq.args_count, oirq.args[0], oirq.args[1], |
247 | of_node_full_name(oirq.controller)); | 247 | of_node_full_name(oirq.np)); |
248 | 248 | ||
249 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, | 249 | virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); |
250 | oirq.size); | ||
251 | } | 250 | } |
252 | if (!virq) { | 251 | if (!virq) { |
253 | pr_debug(" Failed to map !\n"); | 252 | pr_debug(" Failed to map !\n"); |
diff --git a/arch/mips/pci/fixup-lantiq.c b/arch/mips/pci/fixup-lantiq.c index 2e8dbfedae53..81ff0b5e6efa 100644 --- a/arch/mips/pci/fixup-lantiq.c +++ b/arch/mips/pci/fixup-lantiq.c | |||
@@ -25,7 +25,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev) | |||
25 | 25 | ||
26 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 26 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
27 | { | 27 | { |
28 | struct of_irq dev_irq; | 28 | struct of_phandle_args dev_irq; |
29 | int irq; | 29 | int irq; |
30 | 30 | ||
31 | if (of_irq_parse_pci(dev, &dev_irq)) { | 31 | if (of_irq_parse_pci(dev, &dev_irq)) { |
@@ -33,8 +33,7 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |||
33 | slot, pin); | 33 | slot, pin); |
34 | return 0; | 34 | return 0; |
35 | } | 35 | } |
36 | irq = irq_create_of_mapping(dev_irq.controller, dev_irq.specifier, | 36 | irq = irq_create_of_mapping(dev_irq.np, dev_irq.args, dev_irq.args_count); |
37 | dev_irq.size); | ||
38 | dev_info(&dev->dev, "SLOT:%d PIN:%d IRQ:%d\n", slot, pin, irq); | 37 | dev_info(&dev->dev, "SLOT:%d PIN:%d IRQ:%d\n", slot, pin, irq); |
39 | return irq; | 38 | return irq; |
40 | } | 39 | } |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 63ed28a2a545..03bca0d424af 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -228,7 +228,7 @@ int pcibios_add_platform_entries(struct pci_dev *pdev) | |||
228 | */ | 228 | */ |
229 | static int pci_read_irq_line(struct pci_dev *pci_dev) | 229 | static int pci_read_irq_line(struct pci_dev *pci_dev) |
230 | { | 230 | { |
231 | struct of_irq oirq; | 231 | struct of_phandle_args oirq; |
232 | unsigned int virq; | 232 | unsigned int virq; |
233 | 233 | ||
234 | pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev)); | 234 | pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev)); |
@@ -263,11 +263,10 @@ static int pci_read_irq_line(struct pci_dev *pci_dev) | |||
263 | irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); | 263 | irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); |
264 | } else { | 264 | } else { |
265 | pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", | 265 | pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", |
266 | oirq.size, oirq.specifier[0], oirq.specifier[1], | 266 | oirq.args_count, oirq.args[0], oirq.args[1], |
267 | of_node_full_name(oirq.controller)); | 267 | of_node_full_name(oirq.np)); |
268 | 268 | ||
269 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, | 269 | virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); |
270 | oirq.size); | ||
271 | } | 270 | } |
272 | if(virq == NO_IRQ) { | 271 | if(virq == NO_IRQ) { |
273 | pr_debug(" Failed to map !\n"); | 272 | pr_debug(" Failed to map !\n"); |
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c index 40bc371096b7..e8d34d1f640d 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c +++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c | |||
@@ -486,7 +486,7 @@ static __init int celleb_setup_pciex(struct device_node *node, | |||
486 | struct pci_controller *phb) | 486 | struct pci_controller *phb) |
487 | { | 487 | { |
488 | struct resource r; | 488 | struct resource r; |
489 | struct of_irq oirq; | 489 | struct of_phandle_args oirq; |
490 | int virq; | 490 | int virq; |
491 | 491 | ||
492 | /* SMMIO registers; used inside this file */ | 492 | /* SMMIO registers; used inside this file */ |
@@ -511,8 +511,7 @@ static __init int celleb_setup_pciex(struct device_node *node, | |||
511 | pr_err("PCIEXC:Failed to map irq\n"); | 511 | pr_err("PCIEXC:Failed to map irq\n"); |
512 | goto error; | 512 | goto error; |
513 | } | 513 | } |
514 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, | 514 | virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); |
515 | oirq.size); | ||
516 | if (request_irq(virq, pciex_handle_internal_irq, | 515 | if (request_irq(virq, pciex_handle_internal_irq, |
517 | 0, "pciex", (void *)phb)) { | 516 | 0, "pciex", (void *)phb)) { |
518 | pr_err("PCIEXC:Failed to request irq\n"); | 517 | pr_err("PCIEXC:Failed to request irq\n"); |
diff --git a/arch/powerpc/platforms/cell/celleb_scc_sio.c b/arch/powerpc/platforms/cell/celleb_scc_sio.c index 96388b202f4e..06046d512130 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_sio.c +++ b/arch/powerpc/platforms/cell/celleb_scc_sio.c | |||
@@ -45,7 +45,7 @@ static int __init txx9_serial_init(void) | |||
45 | struct device_node *node; | 45 | struct device_node *node; |
46 | int i; | 46 | int i; |
47 | struct uart_port req; | 47 | struct uart_port req; |
48 | struct of_irq irq; | 48 | struct of_phandle_args irq; |
49 | struct resource res; | 49 | struct resource res; |
50 | 50 | ||
51 | for_each_compatible_node(node, "serial", "toshiba,sio-scc") { | 51 | for_each_compatible_node(node, "serial", "toshiba,sio-scc") { |
@@ -66,8 +66,7 @@ static int __init txx9_serial_init(void) | |||
66 | #ifdef CONFIG_SERIAL_TXX9_CONSOLE | 66 | #ifdef CONFIG_SERIAL_TXX9_CONSOLE |
67 | req.membase = ioremap(req.mapbase, 0x24); | 67 | req.membase = ioremap(req.mapbase, 0x24); |
68 | #endif | 68 | #endif |
69 | req.irq = irq_create_of_mapping(irq.controller, | 69 | req.irq = irq_create_of_mapping(irq.np, irq.args, irq.args_count); |
70 | irq.specifier, irq.size); | ||
71 | req.flags |= UPF_IOREMAP | UPF_BUGGY_UART | 70 | req.flags |= UPF_IOREMAP | UPF_BUGGY_UART |
72 | /*HAVE_CTS_LINE*/; | 71 | /*HAVE_CTS_LINE*/; |
73 | req.uartclk = 83300000; | 72 | req.uartclk = 83300000; |
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index b491f406560a..6e842fdbfcab 100644 --- a/arch/powerpc/platforms/cell/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c | |||
@@ -235,10 +235,10 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) | |||
235 | /* First, we check whether we have a real "interrupts" in the device | 235 | /* First, we check whether we have a real "interrupts" in the device |
236 | * tree in case the device-tree is ever fixed | 236 | * tree in case the device-tree is ever fixed |
237 | */ | 237 | */ |
238 | struct of_irq oirq; | 238 | struct of_phandle_args oirq; |
239 | if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0) { | 239 | if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0) { |
240 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, | 240 | virq = irq_create_of_mapping(oirq.np, oirq.args, |
241 | oirq.size); | 241 | oirq.args_count); |
242 | return virq; | 242 | return virq; |
243 | } | 243 | } |
244 | 244 | ||
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c index e6cdb81a0959..e9eb4f83b1d5 100644 --- a/arch/powerpc/platforms/cell/spu_manage.c +++ b/arch/powerpc/platforms/cell/spu_manage.c | |||
@@ -177,7 +177,7 @@ out: | |||
177 | 177 | ||
178 | static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) | 178 | static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) |
179 | { | 179 | { |
180 | struct of_irq oirq; | 180 | struct of_phandle_args oirq; |
181 | int ret; | 181 | int ret; |
182 | int i; | 182 | int i; |
183 | 183 | ||
@@ -188,10 +188,10 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) | |||
188 | goto err; | 188 | goto err; |
189 | } | 189 | } |
190 | ret = -EINVAL; | 190 | ret = -EINVAL; |
191 | pr_debug(" irq %d no 0x%x on %s\n", i, oirq.specifier[0], | 191 | pr_debug(" irq %d no 0x%x on %s\n", i, oirq.args[0], |
192 | oirq.controller->full_name); | 192 | oirq.np->full_name); |
193 | spu->irqs[i] = irq_create_of_mapping(oirq.controller, | 193 | spu->irqs[i] = irq_create_of_mapping(oirq.np, |
194 | oirq.specifier, oirq.size); | 194 | oirq.args, oirq.args_count); |
195 | if (spu->irqs[i] == NO_IRQ) { | 195 | if (spu->irqs[i] == NO_IRQ) { |
196 | pr_debug("spu_new: failed to map it !\n"); | 196 | pr_debug("spu_new: failed to map it !\n"); |
197 | goto err; | 197 | goto err; |
@@ -200,7 +200,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) | |||
200 | return 0; | 200 | return 0; |
201 | 201 | ||
202 | err: | 202 | err: |
203 | pr_debug("failed to map irq %x for spu %s\n", *oirq.specifier, | 203 | pr_debug("failed to map irq %x for spu %s\n", *oirq.args, |
204 | spu->name); | 204 | spu->name); |
205 | for (; i >= 0; i--) { | 205 | for (; i >= 0; i--) { |
206 | if (spu->irqs[i] != NO_IRQ) | 206 | if (spu->irqs[i] != NO_IRQ) |
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c index ac539c1cd808..288226deffa3 100644 --- a/arch/powerpc/platforms/fsl_uli1575.c +++ b/arch/powerpc/platforms/fsl_uli1575.c | |||
@@ -321,8 +321,8 @@ static void hpcd_final_uli5288(struct pci_dev *dev) | |||
321 | { | 321 | { |
322 | struct pci_controller *hose = pci_bus_to_host(dev->bus); | 322 | struct pci_controller *hose = pci_bus_to_host(dev->bus); |
323 | struct device_node *hosenode = hose ? hose->dn : NULL; | 323 | struct device_node *hosenode = hose ? hose->dn : NULL; |
324 | struct of_irq oirq; | 324 | struct of_phandle_args oirq; |
325 | int virq, pin = 2; | 325 | int pin = 2; |
326 | u32 laddr[3]; | 326 | u32 laddr[3]; |
327 | 327 | ||
328 | if (!machine_is(mpc86xx_hpcd)) | 328 | if (!machine_is(mpc86xx_hpcd)) |
@@ -334,9 +334,7 @@ static void hpcd_final_uli5288(struct pci_dev *dev) | |||
334 | laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8); | 334 | laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8); |
335 | laddr[1] = laddr[2] = 0; | 335 | laddr[1] = laddr[2] = 0; |
336 | of_irq_parse_raw(hosenode, &pin, 1, laddr, &oirq); | 336 | of_irq_parse_raw(hosenode, &pin, 1, laddr, &oirq); |
337 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, | 337 | dev->irq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); |
338 | oirq.size); | ||
339 | dev->irq = virq; | ||
340 | } | 338 | } |
341 | 339 | ||
342 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, hpcd_quirk_uli1575); | 340 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, hpcd_quirk_uli1575); |
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 720663e29f47..4c24bf60d39d 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -394,7 +394,7 @@ static void __init pmac_pic_probe_oldstyle(void) | |||
394 | } | 394 | } |
395 | 395 | ||
396 | int of_irq_parse_oldworld(struct device_node *device, int index, | 396 | int of_irq_parse_oldworld(struct device_node *device, int index, |
397 | struct of_irq *out_irq) | 397 | struct of_phandle_args *out_irq) |
398 | { | 398 | { |
399 | const u32 *ints = NULL; | 399 | const u32 *ints = NULL; |
400 | int intlen; | 400 | int intlen; |
@@ -422,9 +422,9 @@ int of_irq_parse_oldworld(struct device_node *device, int index, | |||
422 | if (index >= intlen) | 422 | if (index >= intlen) |
423 | return -EINVAL; | 423 | return -EINVAL; |
424 | 424 | ||
425 | out_irq->controller = NULL; | 425 | out_irq->np = NULL; |
426 | out_irq->specifier[0] = ints[index]; | 426 | out_irq->args[0] = ints[index]; |
427 | out_irq->size = 1; | 427 | out_irq->args_count = 1; |
428 | 428 | ||
429 | return 0; | 429 | return 0; |
430 | } | 430 | } |
diff --git a/arch/powerpc/platforms/pseries/event_sources.c b/arch/powerpc/platforms/pseries/event_sources.c index 850c18c457ad..6dcf9cc38ffb 100644 --- a/arch/powerpc/platforms/pseries/event_sources.c +++ b/arch/powerpc/platforms/pseries/event_sources.c | |||
@@ -25,7 +25,7 @@ void request_event_sources_irqs(struct device_node *np, | |||
25 | const char *name) | 25 | const char *name) |
26 | { | 26 | { |
27 | int i, index, count = 0; | 27 | int i, index, count = 0; |
28 | struct of_irq oirq; | 28 | struct of_phandle_args oirq; |
29 | const u32 *opicprop; | 29 | const u32 *opicprop; |
30 | unsigned int opicplen; | 30 | unsigned int opicplen; |
31 | unsigned int virqs[16]; | 31 | unsigned int virqs[16]; |
@@ -59,9 +59,8 @@ void request_event_sources_irqs(struct device_node *np, | |||
59 | index++) { | 59 | index++) { |
60 | if (count > 15) | 60 | if (count > 15) |
61 | break; | 61 | break; |
62 | virqs[count] = irq_create_of_mapping(oirq.controller, | 62 | virqs[count] = irq_create_of_mapping(oirq.np, oirq.args, |
63 | oirq.specifier, | 63 | oirq.args_count); |
64 | oirq.size); | ||
65 | if (virqs[count] == NO_IRQ) { | 64 | if (virqs[count] == NO_IRQ) { |
66 | pr_err("event-sources: Unable to allocate " | 65 | pr_err("event-sources: Unable to allocate " |
67 | "interrupt number for %s\n", | 66 | "interrupt number for %s\n", |
diff --git a/arch/powerpc/sysdev/mpic_msi.c b/arch/powerpc/sysdev/mpic_msi.c index 463e3a7c193c..7dc39f35a4cc 100644 --- a/arch/powerpc/sysdev/mpic_msi.c +++ b/arch/powerpc/sysdev/mpic_msi.c | |||
@@ -35,7 +35,7 @@ static int mpic_msi_reserve_u3_hwirqs(struct mpic *mpic) | |||
35 | const struct irq_domain_ops *ops = mpic->irqhost->ops; | 35 | const struct irq_domain_ops *ops = mpic->irqhost->ops; |
36 | struct device_node *np; | 36 | struct device_node *np; |
37 | int flags, index, i; | 37 | int flags, index, i; |
38 | struct of_irq oirq; | 38 | struct of_phandle_args oirq; |
39 | 39 | ||
40 | pr_debug("mpic: found U3, guessing msi allocator setup\n"); | 40 | pr_debug("mpic: found U3, guessing msi allocator setup\n"); |
41 | 41 | ||
@@ -64,8 +64,8 @@ static int mpic_msi_reserve_u3_hwirqs(struct mpic *mpic) | |||
64 | 64 | ||
65 | index = 0; | 65 | index = 0; |
66 | while (of_irq_parse_one(np, index++, &oirq) == 0) { | 66 | while (of_irq_parse_one(np, index++, &oirq) == 0) { |
67 | ops->xlate(mpic->irqhost, NULL, oirq.specifier, | 67 | ops->xlate(mpic->irqhost, NULL, oirq.args, |
68 | oirq.size, &hwirq, &flags); | 68 | oirq.args_count, &hwirq, &flags); |
69 | msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, hwirq); | 69 | msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, hwirq); |
70 | } | 70 | } |
71 | } | 71 | } |
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 336193d31ace..125fd1e992ff 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c | |||
@@ -106,7 +106,7 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus) | |||
106 | 106 | ||
107 | static int x86_of_pci_irq_enable(struct pci_dev *dev) | 107 | static int x86_of_pci_irq_enable(struct pci_dev *dev) |
108 | { | 108 | { |
109 | struct of_irq oirq; | 109 | struct of_phandle_args oirq; |
110 | u32 virq; | 110 | u32 virq; |
111 | int ret; | 111 | int ret; |
112 | u8 pin; | 112 | u8 pin; |
@@ -121,8 +121,7 @@ static int x86_of_pci_irq_enable(struct pci_dev *dev) | |||
121 | if (ret) | 121 | if (ret) |
122 | return ret; | 122 | return ret; |
123 | 123 | ||
124 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, | 124 | virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); |
125 | oirq.size); | ||
126 | if (virq == 0) | 125 | if (virq == 0) |
127 | return -EINVAL; | 126 | return -EINVAL; |
128 | dev->irq = virq; | 127 | dev->irq = virq; |
diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 6dacacf22df4..6839bda3ce3c 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c | |||
@@ -36,13 +36,12 @@ | |||
36 | */ | 36 | */ |
37 | unsigned int irq_of_parse_and_map(struct device_node *dev, int index) | 37 | unsigned int irq_of_parse_and_map(struct device_node *dev, int index) |
38 | { | 38 | { |
39 | struct of_irq oirq; | 39 | struct of_phandle_args oirq; |
40 | 40 | ||
41 | if (of_irq_parse_one(dev, index, &oirq)) | 41 | if (of_irq_parse_one(dev, index, &oirq)) |
42 | return 0; | 42 | return 0; |
43 | 43 | ||
44 | return irq_create_of_mapping(oirq.controller, oirq.specifier, | 44 | return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); |
45 | oirq.size); | ||
46 | } | 45 | } |
47 | EXPORT_SYMBOL_GPL(irq_of_parse_and_map); | 46 | EXPORT_SYMBOL_GPL(irq_of_parse_and_map); |
48 | 47 | ||
@@ -94,7 +93,7 @@ struct device_node *of_irq_find_parent(struct device_node *child) | |||
94 | * node exist for the parent. | 93 | * node exist for the parent. |
95 | */ | 94 | */ |
96 | int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec, | 95 | int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec, |
97 | u32 ointsize, const __be32 *addr, struct of_irq *out_irq) | 96 | u32 ointsize, const __be32 *addr, struct of_phandle_args *out_irq) |
98 | { | 97 | { |
99 | struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL; | 98 | struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL; |
100 | const __be32 *tmp, *imap, *imask; | 99 | const __be32 *tmp, *imap, *imask; |
@@ -156,10 +155,10 @@ int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec, | |||
156 | NULL) { | 155 | NULL) { |
157 | pr_debug(" -> got it !\n"); | 156 | pr_debug(" -> got it !\n"); |
158 | for (i = 0; i < intsize; i++) | 157 | for (i = 0; i < intsize; i++) |
159 | out_irq->specifier[i] = | 158 | out_irq->args[i] = |
160 | of_read_number(intspec +i, 1); | 159 | of_read_number(intspec +i, 1); |
161 | out_irq->size = intsize; | 160 | out_irq->args_count = intsize; |
162 | out_irq->controller = ipar; | 161 | out_irq->np = ipar; |
163 | of_node_put(old); | 162 | of_node_put(old); |
164 | return 0; | 163 | return 0; |
165 | } | 164 | } |
@@ -280,7 +279,7 @@ EXPORT_SYMBOL_GPL(of_irq_parse_raw); | |||
280 | * This function resolves an interrupt, walking the tree, for a given | 279 | * This function resolves an interrupt, walking the tree, for a given |
281 | * device-tree node. It's the high level pendant to of_irq_parse_raw(). | 280 | * device-tree node. It's the high level pendant to of_irq_parse_raw(). |
282 | */ | 281 | */ |
283 | int of_irq_parse_one(struct device_node *device, int index, struct of_irq *out_irq) | 282 | int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_args *out_irq) |
284 | { | 283 | { |
285 | struct device_node *p; | 284 | struct device_node *p; |
286 | const __be32 *intspec, *tmp, *addr; | 285 | const __be32 *intspec, *tmp, *addr; |
diff --git a/drivers/of/of_pci_irq.c b/drivers/of/of_pci_irq.c index dceec1048dab..ee3293d4b66b 100644 --- a/drivers/of/of_pci_irq.c +++ b/drivers/of/of_pci_irq.c | |||
@@ -15,7 +15,7 @@ | |||
15 | * PCI tree until an device-node is found, at which point it will finish | 15 | * PCI tree until an device-node is found, at which point it will finish |
16 | * resolving using the OF tree walking. | 16 | * resolving using the OF tree walking. |
17 | */ | 17 | */ |
18 | int of_irq_parse_pci(const struct pci_dev *pdev, struct of_irq *out_irq) | 18 | int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq) |
19 | { | 19 | { |
20 | struct device_node *dn, *ppnode; | 20 | struct device_node *dn, *ppnode; |
21 | struct pci_dev *ppdev; | 21 | struct pci_dev *ppdev; |
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index 7edd60f9e2fd..95ae2e6c0e9d 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c | |||
@@ -638,15 +638,14 @@ static int __init mvebu_pcie_setup(int nr, struct pci_sys_data *sys) | |||
638 | 638 | ||
639 | static int __init mvebu_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 639 | static int __init mvebu_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
640 | { | 640 | { |
641 | struct of_irq oirq; | 641 | struct of_phandle_args oirq; |
642 | int ret; | 642 | int ret; |
643 | 643 | ||
644 | ret = of_irq_parse_pci(dev, &oirq); | 644 | ret = of_irq_parse_pci(dev, &oirq); |
645 | if (ret) | 645 | if (ret) |
646 | return ret; | 646 | return ret; |
647 | 647 | ||
648 | return irq_create_of_mapping(oirq.controller, oirq.specifier, | 648 | return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); |
649 | oirq.size); | ||
650 | } | 649 | } |
651 | 650 | ||
652 | static struct pci_bus *mvebu_pcie_scan_bus(int nr, struct pci_sys_data *sys) | 651 | static struct pci_bus *mvebu_pcie_scan_bus(int nr, struct pci_sys_data *sys) |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 2bb2d622ad12..ed76e3d15dd9 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define __OF_IRQ_H | 2 | #define __OF_IRQ_H |
3 | 3 | ||
4 | #if defined(CONFIG_OF) | 4 | #if defined(CONFIG_OF) |
5 | struct of_irq; | ||
6 | #include <linux/types.h> | 5 | #include <linux/types.h> |
7 | #include <linux/errno.h> | 6 | #include <linux/errno.h> |
8 | #include <linux/irq.h> | 7 | #include <linux/irq.h> |
@@ -18,22 +17,6 @@ struct of_irq; | |||
18 | extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); | 17 | extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); |
19 | 18 | ||
20 | #if defined(CONFIG_OF_IRQ) | 19 | #if defined(CONFIG_OF_IRQ) |
21 | /** | ||
22 | * of_irq - container for device_node/irq_specifier pair for an irq controller | ||
23 | * @controller: pointer to interrupt controller device tree node | ||
24 | * @size: size of interrupt specifier | ||
25 | * @specifier: array of cells @size long specifing the specific interrupt | ||
26 | * | ||
27 | * This structure is returned when an interrupt is mapped. The controller | ||
28 | * field needs to be put() after use | ||
29 | */ | ||
30 | #define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */ | ||
31 | struct of_irq { | ||
32 | struct device_node *controller; /* Interrupt controller node */ | ||
33 | u32 size; /* Specifier size */ | ||
34 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ | ||
35 | }; | ||
36 | |||
37 | typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); | 20 | typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); |
38 | 21 | ||
39 | /* | 22 | /* |
@@ -46,12 +29,12 @@ typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); | |||
46 | extern unsigned int of_irq_workarounds; | 29 | extern unsigned int of_irq_workarounds; |
47 | extern struct device_node *of_irq_dflt_pic; | 30 | extern struct device_node *of_irq_dflt_pic; |
48 | extern int of_irq_parse_oldworld(struct device_node *device, int index, | 31 | extern int of_irq_parse_oldworld(struct device_node *device, int index, |
49 | struct of_irq *out_irq); | 32 | struct of_phandle_args *out_irq); |
50 | #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | 33 | #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ |
51 | #define of_irq_workarounds (0) | 34 | #define of_irq_workarounds (0) |
52 | #define of_irq_dflt_pic (NULL) | 35 | #define of_irq_dflt_pic (NULL) |
53 | static inline int of_irq_parse_oldworld(struct device_node *device, int index, | 36 | static inline int of_irq_parse_oldworld(struct device_node *device, int index, |
54 | struct of_irq *out_irq) | 37 | struct of_phandle_args *out_irq) |
55 | { | 38 | { |
56 | return -EINVAL; | 39 | return -EINVAL; |
57 | } | 40 | } |
@@ -60,9 +43,9 @@ static inline int of_irq_parse_oldworld(struct device_node *device, int index, | |||
60 | 43 | ||
61 | extern int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec, | 44 | extern int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec, |
62 | u32 ointsize, const __be32 *addr, | 45 | u32 ointsize, const __be32 *addr, |
63 | struct of_irq *out_irq); | 46 | struct of_phandle_args *out_irq); |
64 | extern int of_irq_parse_one(struct device_node *device, int index, | 47 | extern int of_irq_parse_one(struct device_node *device, int index, |
65 | struct of_irq *out_irq); | 48 | struct of_phandle_args *out_irq); |
66 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | 49 | extern unsigned int irq_create_of_mapping(struct device_node *controller, |
67 | const u32 *intspec, | 50 | const u32 *intspec, |
68 | unsigned int intsize); | 51 | unsigned int intsize); |
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index 839ba20808fe..f297237349e8 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h | |||
@@ -5,8 +5,8 @@ | |||
5 | #include <linux/msi.h> | 5 | #include <linux/msi.h> |
6 | 6 | ||
7 | struct pci_dev; | 7 | struct pci_dev; |
8 | struct of_irq; | 8 | struct of_phandle_args; |
9 | int of_irq_parse_pci(const struct pci_dev *pdev, struct of_irq *out_irq); | 9 | int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq); |
10 | 10 | ||
11 | struct device_node; | 11 | struct device_node; |
12 | struct device_node *of_pci_find_child_device(struct device_node *parent, | 12 | struct device_node *of_pci_find_child_device(struct device_node *parent, |