diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2007-01-26 02:45:32 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-01-26 02:45:32 -0500 |
commit | 126186a055d965d5a7b1ab560e343ef70694f349 (patch) | |
tree | e4b88a405711760a043994ba910578e8df8d60a5 /arch/powerpc/sysdev/ipic.c | |
parent | e60bd7f14dbb6239d07676be420a21f8a36d014f (diff) |
[POWERPC] 83xx: Return a point to the struct ipic from ipic_init()
It's useful to have access to struct ipic handle that just got created
in ipic_init().
For example, if we want to setup an external IRQ with out
a device node we need access ipic->irqhost to create the virtual to HW
IRQ mapping and to set the IRQ sense. With this we can mimic the old
sense array concept that existed in arch/ppc.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/ipic.c')
-rw-r--r-- | arch/powerpc/sysdev/ipic.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 522aa14e8f0d..473c415e9e25 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
@@ -557,8 +557,7 @@ static struct irq_host_ops ipic_host_ops = { | |||
557 | .xlate = ipic_host_xlate, | 557 | .xlate = ipic_host_xlate, |
558 | }; | 558 | }; |
559 | 559 | ||
560 | void __init ipic_init(struct device_node *node, | 560 | struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) |
561 | unsigned int flags) | ||
562 | { | 561 | { |
563 | struct ipic *ipic; | 562 | struct ipic *ipic; |
564 | struct resource res; | 563 | struct resource res; |
@@ -566,7 +565,7 @@ void __init ipic_init(struct device_node *node, | |||
566 | 565 | ||
567 | ipic = alloc_bootmem(sizeof(struct ipic)); | 566 | ipic = alloc_bootmem(sizeof(struct ipic)); |
568 | if (ipic == NULL) | 567 | if (ipic == NULL) |
569 | return; | 568 | return NULL; |
570 | 569 | ||
571 | memset(ipic, 0, sizeof(struct ipic)); | 570 | memset(ipic, 0, sizeof(struct ipic)); |
572 | ipic->of_node = of_node_get(node); | 571 | ipic->of_node = of_node_get(node); |
@@ -576,12 +575,14 @@ void __init ipic_init(struct device_node *node, | |||
576 | &ipic_host_ops, 0); | 575 | &ipic_host_ops, 0); |
577 | if (ipic->irqhost == NULL) { | 576 | if (ipic->irqhost == NULL) { |
578 | of_node_put(node); | 577 | of_node_put(node); |
579 | return; | 578 | return NULL; |
580 | } | 579 | } |
581 | 580 | ||
582 | ret = of_address_to_resource(node, 0, &res); | 581 | ret = of_address_to_resource(node, 0, &res); |
583 | if (ret) | 582 | if (ret) { |
584 | return; | 583 | of_node_put(node); |
584 | return NULL; | ||
585 | } | ||
585 | 586 | ||
586 | ipic->regs = ioremap(res.start, res.end - res.start + 1); | 587 | ipic->regs = ioremap(res.start, res.end - res.start + 1); |
587 | 588 | ||
@@ -625,6 +626,8 @@ void __init ipic_init(struct device_node *node, | |||
625 | 626 | ||
626 | printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS, | 627 | printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS, |
627 | primary_ipic->regs); | 628 | primary_ipic->regs); |
629 | |||
630 | return ipic; | ||
628 | } | 631 | } |
629 | 632 | ||
630 | int ipic_set_priority(unsigned int virq, unsigned int priority) | 633 | int ipic_set_priority(unsigned int virq, unsigned int priority) |