aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/mpic.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/mpic.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/mpic.c')
-rw-r--r--arch/powerpc/sysdev/mpic.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 74c64c0d3b71..25a81f73cecf 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -271,7 +271,7 @@ static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb,
271{ 271{
272 rb->dbase = mpic->dcr_base; 272 rb->dbase = mpic->dcr_base;
273 rb->doff = offset; 273 rb->doff = offset;
274 rb->dhost = dcr_map(mpic->of_node, rb->dbase + rb->doff, size); 274 rb->dhost = dcr_map(mpic->irqhost->of_node, rb->dbase + rb->doff, size);
275 BUG_ON(!DCR_MAP_OK(rb->dhost)); 275 BUG_ON(!DCR_MAP_OK(rb->dhost));
276} 276}
277 277
@@ -861,10 +861,8 @@ static struct irq_chip mpic_irq_ht_chip = {
861 861
862static int mpic_host_match(struct irq_host *h, struct device_node *node) 862static int mpic_host_match(struct irq_host *h, struct device_node *node)
863{ 863{
864 struct mpic *mpic = h->host_data;
865
866 /* Exact match, unless mpic node is NULL */ 864 /* Exact match, unless mpic node is NULL */
867 return mpic->of_node == NULL || mpic->of_node == node; 865 return h->of_node == NULL || h->of_node == node;
868} 866}
869 867
870static int mpic_host_map(struct irq_host *h, unsigned int virq, 868static int mpic_host_map(struct irq_host *h, unsigned int virq,
@@ -985,10 +983,9 @@ struct mpic * __init mpic_alloc(struct device_node *node,
985 983
986 memset(mpic, 0, sizeof(struct mpic)); 984 memset(mpic, 0, sizeof(struct mpic));
987 mpic->name = name; 985 mpic->name = name;
988 mpic->of_node = of_node_get(node);
989 986
990 mpic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, isu_size, 987 mpic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
991 &mpic_host_ops, 988 isu_size, &mpic_host_ops,
992 flags & MPIC_LARGE_VECTORS ? 2048 : 256); 989 flags & MPIC_LARGE_VECTORS ? 2048 : 256);
993 if (mpic->irqhost == NULL) { 990 if (mpic->irqhost == NULL) {
994 of_node_put(node); 991 of_node_put(node);