diff options
-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; |