Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7578496 authored by Thierry Reding's avatar Thierry Reding Committed by Grant Likely
Browse files

of/irq: Use irq_of_parse_and_map()



Replace some instances of of_irq_map_one()/irq_create_of_mapping() and
of_irq_to_resource() by the simpler equivalent irq_of_parse_and_map().

Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Acked-by: default avatarRob Herring <rob.herring@calxeda.com>
[grant.likely: resolved conflicts with core code renames]
Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
parent 3da52787
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -358,8 +358,7 @@ static struct delay_timer u300_delay_timer;
 */
static void __init u300_timer_init_of(struct device_node *np)
{
	struct resource irq_res;
	int irq;
	unsigned int irq;
	struct clk *clk;
	unsigned long rate;

@@ -368,11 +367,11 @@ static void __init u300_timer_init_of(struct device_node *np)
		panic("could not ioremap system timer\n");

	/* Get the IRQ for the GP1 timer */
	irq = of_irq_to_resource(np, 2, &irq_res);
	if (irq <= 0)
	irq = irq_of_parse_and_map(np, 2);
	if (!irq)
		panic("no IRQ for system timer\n");

	pr_info("U300 GP1 timer @ base: %p, IRQ: %d\n", u300_timer_base, irq);
	pr_info("U300 GP1 timer @ base: %p, IRQ: %u\n", u300_timer_base, irq);

	/* Clock the interrupt controller */
	clk = of_clk_get(np, 0);
+2 −3
Original line number Diff line number Diff line
@@ -486,7 +486,6 @@ static __init int celleb_setup_pciex(struct device_node *node,
				     struct pci_controller *phb)
{
	struct resource	r;
	struct of_phandle_args oirq;
	int virq;

	/* SMMIO registers; used inside this file */
@@ -507,11 +506,11 @@ static __init int celleb_setup_pciex(struct device_node *node,
	phb->ops = &scc_pciex_pci_ops;

	/* internal interrupt handler */
	if (of_irq_parse_one(node, 1, &oirq)) {
	virq = irq_of_parse_and_map(node, 1);
	if (!virq) {
		pr_err("PCIEXC:Failed to map irq\n");
		goto error;
	}
	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");
+3 −3
Original line number Diff line number Diff line
@@ -235,9 +235,9 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
	/* First, we check whether we have a real "interrupts" in the device
	 * 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)
		return irq_create_of_mapping(&oirq);
	virq = irq_of_parse_and_map(pic->host->of_node, 0);
	if (virq)
		return virq;

	/* Now do the horrible hacks */
	tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL);
+4 −5
Original line number Diff line number Diff line
@@ -401,16 +401,15 @@ static int __init fsl_gtm_init(void)
		gtm->clock = *clock;

		for (i = 0; i < ARRAY_SIZE(gtm->timers); i++) {
			int ret;
			struct resource irq;
			unsigned int irq;

			ret = of_irq_to_resource(np, i, &irq);
			if (ret == NO_IRQ) {
			irq = irq_of_parse_and_map(np, i);
			if (irq == NO_IRQ) {
				pr_err("%s: not enough interrupts specified\n",
				       np->full_name);
				goto err;
			}
			gtm->timers[i].irq = irq.start;
			gtm->timers[i].irq = irq;
			gtm->timers[i].gtm = gtm;
		}

+2 −4
Original line number Diff line number Diff line
@@ -237,15 +237,13 @@ static int mpic_msgr_probe(struct platform_device *dev)
		raw_spin_lock_init(&msgr->lock);

		if (receive_mask & (1 << i)) {
			struct resource irq;

			if (of_irq_to_resource(np, irq_index, &irq) == NO_IRQ) {
			msgr->irq = irq_of_parse_and_map(np, irq_index);
			if (msgr->irq == NO_IRQ) {
				dev_err(&dev->dev,
						"Missing interrupt specifier");
				kfree(msgr);
				return -EFAULT;
			}
			msgr->irq = irq.start;
			irq_index += 1;
		} else {
			msgr->irq = NO_IRQ;
Loading