diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-05-26 12:12:30 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-06-09 13:51:14 +1000 |
commit | 84f1c1e08906f2206f2bbdd19e4ff6a0757ff7f8 (patch) | |
tree | 4acd7945bff1656d0f8edf0ae771fc16cbe74ab1 /arch/powerpc/sysdev | |
parent | 997526db9fa408058f23de19c0e12abd9207276b (diff) | |
download | linux-84f1c1e08906f2206f2bbdd19e4ff6a0757ff7f8.tar.gz linux-84f1c1e08906f2206f2bbdd19e4ff6a0757ff7f8.tar.bz2 linux-84f1c1e08906f2206f2bbdd19e4ff6a0757ff7f8.zip |
powerpc: Rework ipic_init() so we can avoid freeing the irq_host
If we do the call to of_address_to_resource() first, then we don't
need to worry about freeing the irq_host (which the code doesn't do
currently anyway).
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/ipic.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 0f2dfb0aaa6a..f95d10ba3b9c 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c @@ -725,6 +725,10 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) struct resource res; u32 temp = 0, ret; + ret = of_address_to_resource(node, 0, &res); + if (ret) + return NULL; + ipic = alloc_bootmem(sizeof(struct ipic)); if (ipic == NULL) return NULL; @@ -739,12 +743,6 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags) return NULL; } - ret = of_address_to_resource(node, 0, &res); - if (ret) { - of_node_put(node); - return NULL; - } - ipic->regs = ioremap(res.start, res.end - res.start + 1); ipic->irqhost->host_data = ipic; |