提交 84f1c1e0 编写于 作者: M Michael Ellerman 提交者: Paul Mackerras

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: NMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 997526db
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册