aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/sysdev/ipic.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-01-26 01:45:32 -0600
committerKumar Gala <galak@kernel.crashing.org>2007-01-26 01:45:32 -0600
commit126186a055d965d5a7b1ab560e343ef70694f349 (patch)
treee4b88a405711760a043994ba910578e8df8d60a5 /arch/powerpc/sysdev/ipic.c
parente60bd7f14dbb6239d07676be420a21f8a36d014f (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.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 522aa14e8f0..473c415e9e2 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 = {
.xlate = ipic_host_xlate,
};
-void __init ipic_init(struct device_node *node,
- unsigned int flags)
+struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
{
struct ipic *ipic;
struct resource res;
@@ -566,7 +565,7 @@ void __init ipic_init(struct device_node *node,
ipic = alloc_bootmem(sizeof(struct ipic));
if (ipic == NULL)
- return;
+ return NULL;
memset(ipic, 0, sizeof(struct ipic));
ipic->of_node = of_node_get(node);
@@ -576,12 +575,14 @@ void __init ipic_init(struct device_node *node,
&ipic_host_ops, 0);
if (ipic->irqhost == NULL) {
of_node_put(node);
- return;
+ return NULL;
}
ret = of_address_to_resource(node, 0, &res);
- if (ret)
- return;
+ if (ret) {
+ of_node_put(node);
+ return NULL;
+ }
ipic->regs = ioremap(res.start, res.end - res.start + 1);
@@ -625,6 +626,8 @@ void __init ipic_init(struct device_node *node,
printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS,
primary_ipic->regs);
+
+ return ipic;
}
int ipic_set_priority(unsigned int virq, unsigned int priority)