aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/axon_msi.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/platforms/cell/axon_msi.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/platforms/cell/axon_msi.c')
-rw-r--r--arch/powerpc/platforms/cell/axon_msi.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index 4c9ab5b70bae..bdd97bb2446d 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -64,7 +64,6 @@
64 64
65 65
66struct axon_msic { 66struct axon_msic {
67 struct device_node *dn;
68 struct irq_host *irq_host; 67 struct irq_host *irq_host;
69 __le32 *fifo; 68 __le32 *fifo;
70 dcr_host_t dcr_host; 69 dcr_host_t dcr_host;
@@ -297,9 +296,7 @@ static int msic_host_map(struct irq_host *h, unsigned int virq,
297 296
298static int msic_host_match(struct irq_host *host, struct device_node *dn) 297static int msic_host_match(struct irq_host *host, struct device_node *dn)
299{ 298{
300 struct axon_msic *msic = host->host_data; 299 return host->of_node == dn;
301
302 return msic->dn == dn;
303} 300}
304 301
305static struct irq_host_ops msic_host_ops = { 302static struct irq_host_ops msic_host_ops = {
@@ -314,7 +311,8 @@ static int axon_msi_notify_reboot(struct notifier_block *nb,
314 u32 tmp; 311 u32 tmp;
315 312
316 list_for_each_entry(msic, &axon_msic_list, list) { 313 list_for_each_entry(msic, &axon_msic_list, list) {
317 pr_debug("axon_msi: disabling %s\n", msic->dn->full_name); 314 pr_debug("axon_msi: disabling %s\n",
315 msic->irq_host->of_node->full_name);
318 tmp = msic_dcr_read(msic, MSIC_CTRL_REG); 316 tmp = msic_dcr_read(msic, MSIC_CTRL_REG);
319 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; 317 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE;
320 msic_dcr_write(msic, MSIC_CTRL_REG, tmp); 318 msic_dcr_write(msic, MSIC_CTRL_REG, tmp);
@@ -370,8 +368,8 @@ static int axon_msi_setup_one(struct device_node *dn)
370 368
371 msic->fifo = page_address(page); 369 msic->fifo = page_address(page);
372 370
373 msic->irq_host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, NR_IRQS, 371 msic->irq_host = irq_alloc_host(of_node_get(dn), IRQ_HOST_MAP_NOMAP,
374 &msic_host_ops, 0); 372 NR_IRQS, &msic_host_ops, 0);
375 if (!msic->irq_host) { 373 if (!msic->irq_host) {
376 printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n", 374 printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n",
377 dn->full_name); 375 dn->full_name);
@@ -387,8 +385,6 @@ static int axon_msi_setup_one(struct device_node *dn)
387 goto out_free_host; 385 goto out_free_host;
388 } 386 }
389 387
390 msic->dn = of_node_get(dn);
391
392 set_irq_data(virq, msic); 388 set_irq_data(virq, msic);
393 set_irq_chained_handler(virq, axon_msi_cascade); 389 set_irq_chained_handler(virq, axon_msi_cascade);
394 pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq); 390 pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq);