Commit 126186a0 authored by Kumar Gala's avatar Kumar Gala
Browse files

[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: default avatarKumar Gala <galak@kernel.crashing.org>
parent e60bd7f1
...@@ -557,8 +557,7 @@ static struct irq_host_ops ipic_host_ops = { ...@@ -557,8 +557,7 @@ static struct irq_host_ops ipic_host_ops = {
.xlate = ipic_host_xlate, .xlate = ipic_host_xlate,
}; };
void __init ipic_init(struct device_node *node, struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
unsigned int flags)
{ {
struct ipic *ipic; struct ipic *ipic;
struct resource res; struct resource res;
...@@ -566,7 +565,7 @@ void __init ipic_init(struct device_node *node, ...@@ -566,7 +565,7 @@ void __init ipic_init(struct device_node *node,
ipic = alloc_bootmem(sizeof(struct ipic)); ipic = alloc_bootmem(sizeof(struct ipic));
if (ipic == NULL) if (ipic == NULL)
return; return NULL;
memset(ipic, 0, sizeof(struct ipic)); memset(ipic, 0, sizeof(struct ipic));
ipic->of_node = of_node_get(node); ipic->of_node = of_node_get(node);
...@@ -576,12 +575,14 @@ void __init ipic_init(struct device_node *node, ...@@ -576,12 +575,14 @@ void __init ipic_init(struct device_node *node,
&ipic_host_ops, 0); &ipic_host_ops, 0);
if (ipic->irqhost == NULL) { if (ipic->irqhost == NULL) {
of_node_put(node); of_node_put(node);
return; return NULL;
} }
ret = of_address_to_resource(node, 0, &res); ret = of_address_to_resource(node, 0, &res);
if (ret) if (ret) {
return; of_node_put(node);
return NULL;
}
ipic->regs = ioremap(res.start, res.end - res.start + 1); ipic->regs = ioremap(res.start, res.end - res.start + 1);
...@@ -625,6 +626,8 @@ void __init ipic_init(struct device_node *node, ...@@ -625,6 +626,8 @@ void __init ipic_init(struct device_node *node,
printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS, printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS,
primary_ipic->regs); primary_ipic->regs);
return ipic;
} }
int ipic_set_priority(unsigned int virq, unsigned int priority) int ipic_set_priority(unsigned int virq, unsigned int priority)
......
...@@ -78,7 +78,7 @@ extern u32 ipic_get_mcp_status(void); ...@@ -78,7 +78,7 @@ extern u32 ipic_get_mcp_status(void);
extern void ipic_clear_mcp_status(u32 mask); extern void ipic_clear_mcp_status(u32 mask);
#ifdef CONFIG_PPC_MERGE #ifdef CONFIG_PPC_MERGE
extern void ipic_init(struct device_node *node, unsigned int flags); extern struct ipic * ipic_init(struct device_node *node, unsigned int flags);
extern unsigned int ipic_get_irq(void); extern unsigned int ipic_get_irq(void);
#else #else
extern void ipic_init(phys_addr_t phys_addr, unsigned int flags, extern void ipic_init(phys_addr_t phys_addr, unsigned int flags,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment