Skip to content

Commit e6d30ab

Browse files
committed
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 <[email protected]> Acked-by: Michal Simek <[email protected]> Acked-by: Tony Lindgren <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Russell King <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]>
1 parent 530210c commit e6d30ab

File tree

16 files changed

+22
-30
lines changed

16 files changed

+22
-30
lines changed

arch/arm/mach-integrator/pci_v3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ static int __init pci_v3_map_irq_dt(const struct pci_dev *dev, u8 slot, u8 pin)
847847
return 0;
848848
}
849849

850-
return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
850+
return irq_create_of_mapping(&oirq);
851851
}
852852

853853
static int __init pci_v3_dtprobe(struct platform_device *pdev,

arch/microblaze/pci/pci-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
246246
oirq.args_count, oirq.args[0], oirq.args[1],
247247
of_node_full_name(oirq.np));
248248

249-
virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
249+
virq = irq_create_of_mapping(&oirq);
250250
}
251251
if (!virq) {
252252
pr_debug(" Failed to map !\n");

arch/mips/pci/fixup-lantiq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
3333
slot, pin);
3434
return 0;
3535
}
36-
irq = irq_create_of_mapping(dev_irq.np, dev_irq.args, dev_irq.args_count);
36+
irq = irq_create_of_mapping(&dev_irq);
3737
dev_info(&dev->dev, "SLOT:%d PIN:%d IRQ:%d\n", slot, pin, irq);
3838
return irq;
3939
}

arch/mips/pci/pci-rt3883.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
594594
return 0;
595595
}
596596

597-
irq = irq_create_of_mapping(dev_irq.np, dev_irq.args, dev_irq.args_count);
597+
irq = irq_create_of_mapping(&dev_irq);
598598

599599
if (irq == 0)
600600
pr_crit("pci %s: no irq found for pin %u\n",

arch/powerpc/kernel/pci-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
266266
oirq.args_count, oirq.args[0], oirq.args[1],
267267
of_node_full_name(oirq.np));
268268

269-
virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
269+
virq = irq_create_of_mapping(&oirq);
270270
}
271271
if(virq == NO_IRQ) {
272272
pr_debug(" Failed to map !\n");

arch/powerpc/platforms/cell/celleb_scc_pciex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static __init int celleb_setup_pciex(struct device_node *node,
511511
pr_err("PCIEXC:Failed to map irq\n");
512512
goto error;
513513
}
514-
virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
514+
virq = irq_create_of_mapping(&oirq);
515515
if (request_irq(virq, pciex_handle_internal_irq,
516516
0, "pciex", (void *)phb)) {
517517
pr_err("PCIEXC:Failed to request irq\n");

arch/powerpc/platforms/cell/celleb_scc_sio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static int __init txx9_serial_init(void)
6666
#ifdef CONFIG_SERIAL_TXX9_CONSOLE
6767
req.membase = ioremap(req.mapbase, 0x24);
6868
#endif
69-
req.irq = irq_create_of_mapping(irq.np, irq.args, irq.args_count);
69+
req.irq = irq_create_of_mapping(&irq);
7070
req.flags |= UPF_IOREMAP | UPF_BUGGY_UART
7171
/*HAVE_CTS_LINE*/;
7272
req.uartclk = 83300000;

arch/powerpc/platforms/cell/spider-pic.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,8 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
236236
* tree in case the device-tree is ever fixed
237237
*/
238238
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);
244241

245242
/* Now do the horrible hacks */
246243
tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL);

arch/powerpc/platforms/cell/spu_manage.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
190190
ret = -EINVAL;
191191
pr_debug(" irq %d no 0x%x on %s\n", i, oirq.args[0],
192192
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);
195194
if (spu->irqs[i] == NO_IRQ) {
196195
pr_debug("spu_new: failed to map it !\n");
197196
goto err;

arch/powerpc/platforms/fsl_uli1575.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static void hpcd_final_uli5288(struct pci_dev *dev)
334334
laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8);
335335
laddr[1] = laddr[2] = 0;
336336
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);
338338
}
339339

340340
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, hpcd_quirk_uli1575);

arch/powerpc/platforms/pseries/event_sources.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ void request_event_sources_irqs(struct device_node *np,
5959
index++) {
6060
if (count > 15)
6161
break;
62-
virqs[count] = irq_create_of_mapping(oirq.np, oirq.args,
63-
oirq.args_count);
62+
virqs[count] = irq_create_of_mapping(&oirq);
6463
if (virqs[count] == NO_IRQ) {
6564
pr_err("event-sources: Unable to allocate "
6665
"interrupt number for %s\n",

arch/x86/kernel/devicetree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static int x86_of_pci_irq_enable(struct pci_dev *dev)
120120
if (ret)
121121
return ret;
122122

123-
virq = irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
123+
virq = irq_create_of_mapping(&oirq);
124124
if (virq == 0)
125125
return -EINVAL;
126126
dev->irq = virq;

drivers/of/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
4141
if (of_irq_parse_one(dev, index, &oirq))
4242
return 0;
4343

44-
return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
44+
return irq_create_of_mapping(&oirq);
4545
}
4646
EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
4747

drivers/pci/host/pci-mvebu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ static int __init mvebu_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
654654
if (ret)
655655
return ret;
656656

657-
return irq_create_of_mapping(oirq.np, oirq.args, oirq.args_count);
657+
return irq_create_of_mapping(&oirq);
658658
}
659659

660660
static struct pci_bus *mvebu_pcie_scan_bus(int nr, struct pci_sys_data *sys)

include/linux/of_irq.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ extern int of_irq_parse_raw(struct device_node *parent, const __be32 *intspec,
3737
struct of_phandle_args *out_irq);
3838
extern int of_irq_parse_one(struct device_node *device, int index,
3939
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);
4341
extern int of_irq_to_resource(struct device_node *dev, int index,
4442
struct resource *r);
4543
extern int of_irq_count(struct device_node *dev);

kernel/irq/irqdomain.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -465,27 +465,26 @@ int irq_create_strict_mappings(struct irq_domain *domain, unsigned int irq_base,
465465
}
466466
EXPORT_SYMBOL_GPL(irq_create_strict_mappings);
467467

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)
470469
{
471470
struct irq_domain *domain;
472471
irq_hw_number_t hwirq;
473472
unsigned int type = IRQ_TYPE_NONE;
474473
unsigned int virq;
475474

476-
domain = controller ? irq_find_host(controller) : irq_default_domain;
475+
domain = irq_data->np ? irq_find_host(irq_data->np) : irq_default_domain;
477476
if (!domain) {
478477
pr_warn("no irq domain found for %s !\n",
479-
of_node_full_name(controller));
478+
of_node_full_name(irq_data->np));
480479
return 0;
481480
}
482481

483482
/* If domain has no translation, then we assume interrupt line */
484483
if (domain->ops->xlate == NULL)
485-
hwirq = intspec[0];
484+
hwirq = irq_data->args[0];
486485
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))
489488
return 0;
490489
}
491490

0 commit comments

Comments
 (0)