diff options
author | Thierry Reding <thierry.reding@gmail.com> | 2013-09-18 09:24:44 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2013-10-24 06:50:35 -0400 |
commit | f7578496a671a96e501f16a5104893275e32c33a (patch) | |
tree | f1bc2db4847acdea2bb4c777782b29c35c084ae2 /arch | |
parent | 3da5278727a895d49a601f67fd49dffa0b80f9a5 (diff) |
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: Thierry Reding <treding@nvidia.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
[grant.likely: resolved conflicts with core code renames]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-u300/timer.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/celleb_scc_pciex.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spider-pic.c | 6 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_gtm.c | 9 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic_msgr.c | 6 |
5 files changed, 15 insertions, 20 deletions
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c index b5db207dfd1e..9a5f9fb352ce 100644 --- a/arch/arm/mach-u300/timer.c +++ b/arch/arm/mach-u300/timer.c | |||
@@ -358,8 +358,7 @@ static struct delay_timer u300_delay_timer; | |||
358 | */ | 358 | */ |
359 | static void __init u300_timer_init_of(struct device_node *np) | 359 | static void __init u300_timer_init_of(struct device_node *np) |
360 | { | 360 | { |
361 | struct resource irq_res; | 361 | unsigned int irq; |
362 | int irq; | ||
363 | struct clk *clk; | 362 | struct clk *clk; |
364 | unsigned long rate; | 363 | unsigned long rate; |
365 | 364 | ||
@@ -368,11 +367,11 @@ static void __init u300_timer_init_of(struct device_node *np) | |||
368 | panic("could not ioremap system timer\n"); | 367 | panic("could not ioremap system timer\n"); |
369 | 368 | ||
370 | /* Get the IRQ for the GP1 timer */ | 369 | /* Get the IRQ for the GP1 timer */ |
371 | irq = of_irq_to_resource(np, 2, &irq_res); | 370 | irq = irq_of_parse_and_map(np, 2); |
372 | if (irq <= 0) | 371 | if (!irq) |
373 | panic("no IRQ for system timer\n"); | 372 | panic("no IRQ for system timer\n"); |
374 | 373 | ||
375 | pr_info("U300 GP1 timer @ base: %p, IRQ: %d\n", u300_timer_base, irq); | 374 | pr_info("U300 GP1 timer @ base: %p, IRQ: %u\n", u300_timer_base, irq); |
376 | 375 | ||
377 | /* Clock the interrupt controller */ | 376 | /* Clock the interrupt controller */ |
378 | clk = of_clk_get(np, 0); | 377 | clk = of_clk_get(np, 0); |
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c index b3ea96db5b06..4278acfa2ede 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c +++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c | |||
@@ -486,7 +486,6 @@ 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_phandle_args oirq; | ||
490 | int virq; | 489 | int virq; |
491 | 490 | ||
492 | /* SMMIO registers; used inside this file */ | 491 | /* SMMIO registers; used inside this file */ |
@@ -507,11 +506,11 @@ static __init int celleb_setup_pciex(struct device_node *node, | |||
507 | phb->ops = &scc_pciex_pci_ops; | 506 | phb->ops = &scc_pciex_pci_ops; |
508 | 507 | ||
509 | /* internal interrupt handler */ | 508 | /* internal interrupt handler */ |
510 | if (of_irq_parse_one(node, 1, &oirq)) { | 509 | virq = irq_of_parse_and_map(node, 1); |
510 | if (!virq) { | ||
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); | ||
515 | if (request_irq(virq, pciex_handle_internal_irq, | 514 | if (request_irq(virq, pciex_handle_internal_irq, |
516 | 0, "pciex", (void *)phb)) { | 515 | 0, "pciex", (void *)phb)) { |
517 | pr_err("PCIEXC:Failed to request irq\n"); | 516 | pr_err("PCIEXC:Failed to request irq\n"); |
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index d20680446174..1f72f4ab6353 100644 --- a/arch/powerpc/platforms/cell/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c | |||
@@ -235,9 +235,9 @@ 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_phandle_args oirq; | 238 | virq = irq_of_parse_and_map(pic->host->of_node, 0); |
239 | if (of_irq_parse_one(pic->host->of_node, 0, &oirq) == 0) | 239 | if (virq) |
240 | return irq_create_of_mapping(&oirq); | 240 | return virq; |
241 | 241 | ||
242 | /* Now do the horrible hacks */ | 242 | /* Now do the horrible hacks */ |
243 | tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL); | 243 | tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL); |
diff --git a/arch/powerpc/sysdev/fsl_gtm.c b/arch/powerpc/sysdev/fsl_gtm.c index 0eb871cc3437..dd0d5be6cd1f 100644 --- a/arch/powerpc/sysdev/fsl_gtm.c +++ b/arch/powerpc/sysdev/fsl_gtm.c | |||
@@ -401,16 +401,15 @@ static int __init fsl_gtm_init(void) | |||
401 | gtm->clock = *clock; | 401 | gtm->clock = *clock; |
402 | 402 | ||
403 | for (i = 0; i < ARRAY_SIZE(gtm->timers); i++) { | 403 | for (i = 0; i < ARRAY_SIZE(gtm->timers); i++) { |
404 | int ret; | 404 | unsigned int irq; |
405 | struct resource irq; | ||
406 | 405 | ||
407 | ret = of_irq_to_resource(np, i, &irq); | 406 | irq = irq_of_parse_and_map(np, i); |
408 | if (ret == NO_IRQ) { | 407 | if (irq == NO_IRQ) { |
409 | pr_err("%s: not enough interrupts specified\n", | 408 | pr_err("%s: not enough interrupts specified\n", |
410 | np->full_name); | 409 | np->full_name); |
411 | goto err; | 410 | goto err; |
412 | } | 411 | } |
413 | gtm->timers[i].irq = irq.start; | 412 | gtm->timers[i].irq = irq; |
414 | gtm->timers[i].gtm = gtm; | 413 | gtm->timers[i].gtm = gtm; |
415 | } | 414 | } |
416 | 415 | ||
diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c index c75325865a85..2c9b52aa266c 100644 --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c | |||
@@ -237,15 +237,13 @@ static int mpic_msgr_probe(struct platform_device *dev) | |||
237 | raw_spin_lock_init(&msgr->lock); | 237 | raw_spin_lock_init(&msgr->lock); |
238 | 238 | ||
239 | if (receive_mask & (1 << i)) { | 239 | if (receive_mask & (1 << i)) { |
240 | struct resource irq; | 240 | msgr->irq = irq_of_parse_and_map(np, irq_index); |
241 | 241 | if (msgr->irq == NO_IRQ) { | |
242 | if (of_irq_to_resource(np, irq_index, &irq) == NO_IRQ) { | ||
243 | dev_err(&dev->dev, | 242 | dev_err(&dev->dev, |
244 | "Missing interrupt specifier"); | 243 | "Missing interrupt specifier"); |
245 | kfree(msgr); | 244 | kfree(msgr); |
246 | return -EFAULT; | 245 | return -EFAULT; |
247 | } | 246 | } |
248 | msgr->irq = irq.start; | ||
249 | irq_index += 1; | 247 | irq_index += 1; |
250 | } else { | 248 | } else { |
251 | msgr->irq = NO_IRQ; | 249 | msgr->irq = NO_IRQ; |