aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/cpm2_pic.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/cpm2_pic.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/cpm2_pic.c')
-rw-r--r--arch/powerpc/sysdev/cpm2_pic.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index eabfe06fe05c..d9ab30c66ebf 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -50,7 +50,6 @@
50 50
51static intctl_cpm2_t *cpm2_intctl; 51static intctl_cpm2_t *cpm2_intctl;
52 52
53static struct device_node *cpm2_pic_node;
54static struct irq_host *cpm2_pic_host; 53static struct irq_host *cpm2_pic_host;
55#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 54#define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
56static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 55static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
@@ -208,7 +207,7 @@ unsigned int cpm2_get_irq(void)
208 207
209static int cpm2_pic_host_match(struct irq_host *h, struct device_node *node) 208static int cpm2_pic_host_match(struct irq_host *h, struct device_node *node)
210{ 209{
211 return cpm2_pic_node == node; 210 return h->of_node == node;
212} 211}
213 212
214static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq, 213static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq,
@@ -273,8 +272,8 @@ void cpm2_pic_init(struct device_node *node)
273 out_be32(&cpm2_intctl->ic_scprrl, 0x05309770); 272 out_be32(&cpm2_intctl->ic_scprrl, 0x05309770);
274 273
275 /* create a legacy host */ 274 /* create a legacy host */
276 cpm2_pic_node = of_node_get(node); 275 cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
277 cpm2_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &cpm2_pic_host_ops, 64); 276 64, &cpm2_pic_host_ops, 64);
278 if (cpm2_pic_host == NULL) { 277 if (cpm2_pic_host == NULL) {
279 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); 278 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
280 return; 279 return;