of/irq: simplify args to irq_create_of_mapping
authorGrant Likely <grant.likely@linaro.org>
Sun, 15 Sep 2013 15:55:53 +0000 (16:55 +0100)
committerGrant Likely <grant.likely@linaro.org>
Thu, 24 Oct 2013 10:42:57 +0000 (11:42 +0100)
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>
16 files changed:
arch/arm/mach-integrator/pci_v3.c
arch/microblaze/pci/pci-common.c
arch/mips/pci/fixup-lantiq.c
arch/mips/pci/pci-rt3883.c
arch/powerpc/kernel/pci-common.c
arch/powerpc/platforms/cell/celleb_scc_pciex.c
arch/powerpc/platforms/cell/celleb_scc_sio.c
arch/powerpc/platforms/cell/spider-pic.c
arch/powerpc/platforms/cell/spu_manage.c
arch/powerpc/platforms/fsl_uli1575.c
arch/powerpc/platforms/pseries/event_sources.c
arch/x86/kernel/devicetree.c
drivers/of/irq.c
drivers/pci/host/pci-mvebu.c
include/linux/of_irq.h
kernel/irq/irqdomain.c

index 2d6b4da90fb4f9ec6f585e5354a57c3ee5715573..bb3aeb31a54e4bdf072ca686a60b5795df0f0251 100644 (file)
@@ -847,7 +847,7 @@ static int __init pci_v3_map_irq_dt(const struct pci_dev *dev, u8 slot, u8 pin)
                return 0;
        }
 
-       return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
+       return irq_create_of_mapping(&oirq);
 }
 
 static int __init pci_v3_dtprobe(struct platform_device *pdev,
index c9302c4f8a57053b9f66457dd8b184f149cda7e0..60b386c72c57a130efff00bb43d107362b1e9afb 100644 (file)
@@ -246,7 +246,7 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
                         oirq.args_count, oirq.args[0], oirq.args[1],
                         of_node_full_name(oirq.np));
 
-               virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
+               virq = irq_create_of_mapping(&oirq);
        }
        if (!virq) {
                pr_debug(" Failed to map !\n");
index 81ff0b5e6efa358821070288f8eeefa65fd9c393..aef60e75003ed9ed2dd4df4becb67514e718eeea 100644 (file)
@@ -33,7 +33,7 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
                        slot, pin);
                return 0;
        }
-       irq = irq_create_of_mapping(dev_irq.np, dev_irq.args, dev_irq.args_count);
+       irq = irq_create_of_mapping(&dev_irq);
        dev_info(&dev->dev, "SLOT:%d PIN:%d IRQ:%d\n", slot, pin, irq);
        return irq;
 }
index 0f08a5ba0b2a9d68933037198dcd49707e704bbd..eadc4310cd36c7aeb30bd5377c304b276a7ecde6 100644 (file)
@@ -594,7 +594,7 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
                return 0;
        }
 
-       irq = irq_create_of_mapping(dev_irq.np, dev_irq.args, dev_irq.args_count);
+       irq = irq_create_of_mapping(&dev_irq);
 
        if (irq == 0)
                pr_crit("pci %s: no irq found for pin %u\n",
index 96c46235fda29395cdf721e54b6491748b0b2dc3..a1e3e40ca3fded6a04fc592a88e68fa3ce844dae 100644 (file)
@@ -266,7 +266,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
                         oirq.args_count, oirq.args[0], oirq.args[1],
                         of_node_full_name(oirq.np));
 
-               virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
+               virq = irq_create_of_mapping(&oirq);
        }
        if(virq == NO_IRQ) {
                pr_debug(" Failed to map !\n");
index e8d34d1f640de62511268f6c476478fb5eb7c57b..b3ea96db5b06a15b6efc80f4ee5b1963b08cc641 100644 (file)
@@ -511,7 +511,7 @@ static __init int celleb_setup_pciex(struct device_node *node,
                pr_err("PCIEXC:Failed to map irq\n");
                goto error;
        }
-       virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
+       virq = irq_create_of_mapping(&oirq);
        if (request_irq(virq, pciex_handle_internal_irq,
                        0, "pciex", (void *)phb)) {
                pr_err("PCIEXC:Failed to request irq\n");
index 06046d512130fe5780d3cc8b4cfd8423409cb0b8..c8eb571938264c2dd77aa83eec2c9bf296d85f68 100644 (file)
@@ -66,7 +66,7 @@ static int __init txx9_serial_init(void)
 #ifdef CONFIG_SERIAL_TXX9_CONSOLE
                        req.membase = ioremap(req.mapbase, 0x24);
 #endif
-                       req.irq = irq_create_of_mapping(irq.np, irq.args, irq.args_count);
+                       req.irq = irq_create_of_mapping(&irq);
                        req.flags |= UPF_IOREMAP | UPF_BUGGY_UART
                                /*HAVE_CTS_LINE*/;
                        req.uartclk = 83300000;
index 6e842fdbfcabf783f466e7480e531135d79f518e..d20680446174f477665bf9892c846b52efe3f8f0 100644 (file)
@@ -236,11 +236,8 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
         * tree in case the device-tree is ever fixed
         */
        struct of_phandle_args oirq;
-       if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0) {
-               virq = irq_create_of_mapping(oirq.np, oirq.args,
-                                            oirq.args_count);
-               return virq;
-       }
+       if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0)
+               return irq_create_of_mapping(&oirq);
 
        /* Now do the horrible hacks */
        tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL);
index e9eb4f83b1d5560b07b91d538d4fc04cb3b8a57e..c3327f3d8cf75a8a7a6ea062efac0612b37f6595 100644 (file)
@@ -190,8 +190,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
                ret = -EINVAL;
                pr_debug("  irq %d no 0x%x on %s\n", i, oirq.args[0],
                         oirq.np->full_name);
-               spu->irqs[i] = irq_create_of_mapping(oirq.np,
-                                       oirq.args, oirq.args_count);
+               spu->irqs[i] = irq_create_of_mapping(&oirq);
                if (spu->irqs[i] == NO_IRQ) {
                        pr_debug("spu_new: failed to map it !\n");
                        goto err;
index 288226deffa3b0787252abaf16663175e50e2053..8904046556ad544cc24dc827ae65fdbe391602c7 100644 (file)
@@ -334,7 +334,7 @@ static void hpcd_final_uli5288(struct pci_dev *dev)
        laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8);
        laddr[1] = laddr[2] = 0;
        of_irq_parse_raw(hosenode, &pin, 1, laddr, &oirq);
-       dev->irq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
+       dev->irq = irq_create_of_mapping(&oirq);
 }
 
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, hpcd_quirk_uli1575);
index 6dcf9cc38ffb321f588eafc225d37ac6941fdc8d..18380e8f6dfe7eb112de9026b42318da7de60799 100644 (file)
@@ -59,8 +59,7 @@ void request_event_sources_irqs(struct device_node *np,
                     index++) {
                        if (count > 15)
                                break;
-                       virqs[count] = irq_create_of_mapping(oirq.np, oirq.args,
-                                                           oirq.args_count);
+                       virqs[count] = irq_create_of_mapping(&oirq);
                        if (virqs[count] == NO_IRQ) {
                                pr_err("event-sources: Unable to allocate "
                                       "interrupt number for %s\n",
index 00986988a10e3205d503ec61be76957936425a8d..d39948f654a0c1b7e24cfe578f148a2225f87905 100644 (file)
@@ -120,7 +120,7 @@ static int x86_of_pci_irq_enable(struct pci_dev *dev)
        if (ret)
                return ret;
 
-       virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
+       virq = irq_create_of_mapping(&oirq);
        if (virq == 0)
                return -EINVAL;
        dev->irq = virq;
index a7db38a634030773504be811094f86e5d0a3e7f0..84184c44e8db3b2d4a1172da1faa27a31ed5ea0a 100644 (file)
@@ -41,7 +41,7 @@ unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
        if (of_irq_parse_one(dev, index, &oirq))
                return 0;
 
-       return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
+       return irq_create_of_mapping(&oirq);
 }
 EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
 
index c5e57f82b9af841a390362c696c9e42fa9f693eb..3a8d01ec50f7f35e2fd2f42d78a9e6a226971424 100644 (file)
@@ -654,7 +654,7 @@ static int __init mvebu_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
        if (ret)
                return ret;
 
-       return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
+       return irq_create_of_mapping(&oirq);
 }
 
 static struct pci_bus *mvebu_pcie_scan_bus(int nr, struct pci_sys_data *sys)
index 8d9f85560d48e94c90ff4b56514a3f0e5fb2dc98..3bbba8d6adc81911db90b8493dcaac9fb3e383e5 100644 (file)
@@ -37,9 +37,7 @@ extern int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec,
                          struct of_phandle_args *out_irq);
 extern int of_irq_parse_one(struct device_node *device, int index,
                          struct of_phandle_args *out_irq);
-extern unsigned int irq_create_of_mapping(struct device_node *controller,
-                                         const u32 *intspec,
-                                         unsigned int intsize);
+extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data);
 extern int of_irq_to_resource(struct device_node *dev, int index,
                              struct resource *r);
 extern int of_irq_count(struct device_node *dev);
index 706724e9835dc07f72ca1bc21b1cba0bf86f5d65..cf68bb36fe5885dd2ba7b9c9ccef3c5165a320d3 100644 (file)
@@ -465,27 +465,26 @@ int irq_create_strict_mappings(struct irq_domain *domain, unsigned int irq_base,
 }
 EXPORT_SYMBOL_GPL(irq_create_strict_mappings);
 
-unsigned int irq_create_of_mapping(struct device_node *controller,
-                                  const u32 *intspec, unsigned int intsize)
+unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data)
 {
        struct irq_domain *domain;
        irq_hw_number_t hwirq;
        unsigned int type = IRQ_TYPE_NONE;
        unsigned int virq;
 
-       domain = controller ? irq_find_host(controller) : irq_default_domain;
+       domain = irq_data->np ? irq_find_host(irq_data->np) : irq_default_domain;
        if (!domain) {
                pr_warn("no irq domain found for %s !\n",
-                       of_node_full_name(controller));
+                       of_node_full_name(irq_data->np));
                return 0;
        }
 
        /* If domain has no translation, then we assume interrupt line */
        if (domain->ops->xlate == NULL)
-               hwirq = intspec[0];
+               hwirq = irq_data->args[0];
        else {
-               if (domain->ops->xlate(domain, controller, intspec, intsize,
-                                    &hwirq, &type))
+               if (domain->ops->xlate(domain, irq_data->np, irq_data->args,
+                                       irq_data->args_count, &hwirq, &type))
                        return 0;
        }