Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of/irq: simplify args to irq_create_of_mapping

All the callers of irq_create_of_mapping() pass the contents of a struct
of_phandle_args structure to the function. Since all the callers already
have an of_phandle_args pointer, why not pass it directly to
irq_create_of_mapping()?

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Tony Lindgren <tony@atomide.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>

+22 -30
+1 -1
arch/arm/mach-integrator/pci_v3.c
··· 847 847 return 0; 848 848 } 849 849 850 - return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); 850 + return irq_create_of_mapping(&oirq); 851 851 } 852 852 853 853 static int __init pci_v3_dtprobe(struct platform_device *pdev,
+1 -1
arch/microblaze/pci/pci-common.c
··· 246 246 oirq.args_count, oirq.args[0], oirq.args[1], 247 247 of_node_full_name(oirq.np)); 248 248 249 - virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); 249 + virq = irq_create_of_mapping(&oirq); 250 250 } 251 251 if (!virq) { 252 252 pr_debug(" Failed to map !\n");
+1 -1
arch/mips/pci/fixup-lantiq.c
··· 33 33 slot, pin); 34 34 return 0; 35 35 } 36 - irq = irq_create_of_mapping(dev_irq.np, dev_irq.args, dev_irq.args_count); 36 + irq = irq_create_of_mapping(&dev_irq); 37 37 dev_info(&dev->dev, "SLOT:%d PIN:%d IRQ:%d\n", slot, pin, irq); 38 38 return irq; 39 39 }
+1 -1
arch/mips/pci/pci-rt3883.c
··· 594 594 return 0; 595 595 } 596 596 597 - irq = irq_create_of_mapping(dev_irq.np, dev_irq.args, dev_irq.args_count); 597 + irq = irq_create_of_mapping(&dev_irq); 598 598 599 599 if (irq == 0) 600 600 pr_crit("pci %s: no irq found for pin %u\n",
+1 -1
arch/powerpc/kernel/pci-common.c
··· 266 266 oirq.args_count, oirq.args[0], oirq.args[1], 267 267 of_node_full_name(oirq.np)); 268 268 269 - virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); 269 + virq = irq_create_of_mapping(&oirq); 270 270 } 271 271 if(virq == NO_IRQ) { 272 272 pr_debug(" Failed to map !\n");
+1 -1
arch/powerpc/platforms/cell/celleb_scc_pciex.c
··· 511 511 pr_err("PCIEXC:Failed to map irq\n"); 512 512 goto error; 513 513 } 514 - virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); 514 + virq = irq_create_of_mapping(&oirq); 515 515 if (request_irq(virq, pciex_handle_internal_irq, 516 516 0, "pciex", (void *)phb)) { 517 517 pr_err("PCIEXC:Failed to request irq\n");
+1 -1
arch/powerpc/platforms/cell/celleb_scc_sio.c
··· 66 66 #ifdef CONFIG_SERIAL_TXX9_CONSOLE 67 67 req.membase = ioremap(req.mapbase, 0x24); 68 68 #endif 69 - req.irq = irq_create_of_mapping(irq.np, irq.args, irq.args_count); 69 + req.irq = irq_create_of_mapping(&irq); 70 70 req.flags |= UPF_IOREMAP | UPF_BUGGY_UART 71 71 /*HAVE_CTS_LINE*/; 72 72 req.uartclk = 83300000;
+2 -5
arch/powerpc/platforms/cell/spider-pic.c
··· 236 236 * tree in case the device-tree is ever fixed 237 237 */ 238 238 struct of_phandle_args oirq; 239 - if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0) { 240 - virq = irq_create_of_mapping(oirq.np, oirq.args, 241 - oirq.args_count); 242 - return virq; 243 - } 239 + if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0) 240 + return irq_create_of_mapping(&oirq); 244 241 245 242 /* Now do the horrible hacks */ 246 243 tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL);
+1 -2
arch/powerpc/platforms/cell/spu_manage.c
··· 190 190 ret = -EINVAL; 191 191 pr_debug(" irq %d no 0x%x on %s\n", i, oirq.args[0], 192 192 oirq.np->full_name); 193 - spu->irqs[i] = irq_create_of_mapping(oirq.np, 194 - oirq.args, oirq.args_count); 193 + spu->irqs[i] = irq_create_of_mapping(&oirq); 195 194 if (spu->irqs[i] == NO_IRQ) { 196 195 pr_debug("spu_new: failed to map it !\n"); 197 196 goto err;
+1 -1
arch/powerpc/platforms/fsl_uli1575.c
··· 334 334 laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8); 335 335 laddr[1] = laddr[2] = 0; 336 336 of_irq_parse_raw(hosenode, &pin, 1, laddr, &oirq); 337 - dev->irq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); 337 + dev->irq = irq_create_of_mapping(&oirq); 338 338 } 339 339 340 340 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, hpcd_quirk_uli1575);
+1 -2
arch/powerpc/platforms/pseries/event_sources.c
··· 59 59 index++) { 60 60 if (count > 15) 61 61 break; 62 - virqs[count] = irq_create_of_mapping(oirq.np, oirq.args, 63 - oirq.args_count); 62 + virqs[count] = irq_create_of_mapping(&oirq); 64 63 if (virqs[count] == NO_IRQ) { 65 64 pr_err("event-sources: Unable to allocate " 66 65 "interrupt number for %s\n",
+1 -1
arch/x86/kernel/devicetree.c
··· 120 120 if (ret) 121 121 return ret; 122 122 123 - virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); 123 + virq = irq_create_of_mapping(&oirq); 124 124 if (virq == 0) 125 125 return -EINVAL; 126 126 dev->irq = virq;
+1 -1
drivers/of/irq.c
··· 41 41 if (of_irq_parse_one(dev, index, &oirq)) 42 42 return 0; 43 43 44 - return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); 44 + return irq_create_of_mapping(&oirq); 45 45 } 46 46 EXPORT_SYMBOL_GPL(irq_of_parse_and_map); 47 47
+1 -1
drivers/pci/host/pci-mvebu.c
··· 654 654 if (ret) 655 655 return ret; 656 656 657 - return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count); 657 + return irq_create_of_mapping(&oirq); 658 658 } 659 659 660 660 static struct pci_bus *mvebu_pcie_scan_bus(int nr, struct pci_sys_data *sys)
+1 -3
include/linux/of_irq.h
··· 37 37 struct of_phandle_args *out_irq); 38 38 extern int of_irq_parse_one(struct device_node *device, int index, 39 39 struct of_phandle_args *out_irq); 40 - extern unsigned int irq_create_of_mapping(struct device_node *controller, 41 - const u32 *intspec, 42 - unsigned int intsize); 40 + extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data); 43 41 extern int of_irq_to_resource(struct device_node *dev, int index, 44 42 struct resource *r); 45 43 extern int of_irq_count(struct device_node *dev);
+6 -7
kernel/irq/irqdomain.c
··· 465 465 } 466 466 EXPORT_SYMBOL_GPL(irq_create_strict_mappings); 467 467 468 - unsigned int irq_create_of_mapping(struct device_node *controller, 469 - const u32 *intspec, unsigned int intsize) 468 + unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data) 470 469 { 471 470 struct irq_domain *domain; 472 471 irq_hw_number_t hwirq; 473 472 unsigned int type = IRQ_TYPE_NONE; 474 473 unsigned int virq; 475 474 476 - domain = controller ? irq_find_host(controller) : irq_default_domain; 475 + domain = irq_data->np ? irq_find_host(irq_data->np) : irq_default_domain; 477 476 if (!domain) { 478 477 pr_warn("no irq domain found for %s !\n", 479 - of_node_full_name(controller)); 478 + of_node_full_name(irq_data->np)); 480 479 return 0; 481 480 } 482 481 483 482 /* If domain has no translation, then we assume interrupt line */ 484 483 if (domain->ops->xlate == NULL) 485 - hwirq = intspec[0]; 484 + hwirq = irq_data->args[0]; 486 485 else { 487 - if (domain->ops->xlate(domain, controller, intspec, intsize, 488 - &hwirq, &type)) 486 + if (domain->ops->xlate(domain, irq_data->np, irq_data->args, 487 + irq_data->args_count, &hwirq, &type)) 489 488 return 0; 490 489 } 491 490