aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/uic.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-08-28 04:47:54 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-13 11:33:20 -0400
commit52964f87c64e6c6ea671b5bf3030fb1494090a48 (patch)
tree2e20d81bc05b60b7108733daf5713ea640ad2477 /arch/powerpc/sysdev/uic.c
parent0ae0b54565a8dcc2b98de694b998e765de15b713 (diff)
[POWERPC] Add an optional device_node pointer to the irq_host
The majority of irq_host implementations (3 out of 4) are associated with a device_node, and need to stash it somewhere. Rather than having it somewhere different for each host, add an optional device_node pointer to the irq_host structure. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/sysdev/uic.c')
-rw-r--r--arch/powerpc/sysdev/uic.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 47180b3fca56..bf3766754173 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -56,9 +56,6 @@ struct uic {
56 56
57 /* For secondary UICs, the cascade interrupt's irqaction */ 57 /* For secondary UICs, the cascade interrupt's irqaction */
58 struct irqaction cascade; 58 struct irqaction cascade;
59
60 /* The device node of the interrupt controller */
61 struct device_node *of_node;
62}; 59};
63 60
64static void uic_unmask_irq(unsigned int virq) 61static void uic_unmask_irq(unsigned int virq)
@@ -220,8 +217,7 @@ out_unlock:
220 217
221static int uic_host_match(struct irq_host *h, struct device_node *node) 218static int uic_host_match(struct irq_host *h, struct device_node *node)
222{ 219{
223 struct uic *uic = h->host_data; 220 return h->of_node == node;
224 return uic->of_node == node;
225} 221}
226 222
227static int uic_host_map(struct irq_host *h, unsigned int virq, 223static int uic_host_map(struct irq_host *h, unsigned int virq,
@@ -291,7 +287,6 @@ static struct uic * __init uic_init_one(struct device_node *node)
291 287
292 memset(uic, 0, sizeof(*uic)); 288 memset(uic, 0, sizeof(*uic));
293 spin_lock_init(&uic->lock); 289 spin_lock_init(&uic->lock);
294 uic->of_node = of_node_get(node);
295 indexp = of_get_property(node, "cell-index", &len); 290 indexp = of_get_property(node, "cell-index", &len);
296 if (!indexp || (len != sizeof(u32))) { 291 if (!indexp || (len != sizeof(u32))) {
297 printk(KERN_ERR "uic: Device node %s has missing or invalid " 292 printk(KERN_ERR "uic: Device node %s has missing or invalid "
@@ -308,8 +303,8 @@ static struct uic * __init uic_init_one(struct device_node *node)
308 } 303 }
309 uic->dcrbase = *dcrreg; 304 uic->dcrbase = *dcrreg;
310 305
311 uic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, NR_UIC_INTS, 306 uic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
312 &uic_host_ops, -1); 307 NR_UIC_INTS, &uic_host_ops, -1);
313 if (! uic->irqhost) { 308 if (! uic->irqhost) {
314 of_node_put(node); 309 of_node_put(node);
315 return NULL; /* FIXME: panic? */ 310 return NULL; /* FIXME: panic? */