diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-05-25 22:12:30 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-06-08 23:51:13 -0400 |
commit | 997526db9fa408058f23de19c0e12abd9207276b (patch) | |
tree | a4a49702904ed4824453ef049f780c1712b99e76 | |
parent | 7c4f10b9003dc8423df07574ba197bbbe3bc382b (diff) |
powerpc: Rework Axon MSI setup so we can avoid freeing the irq_host
If we do the call to irq_of_parse_and_map() first, then we don't
need to worry about freeing the irq_host.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/cell/axon_msi.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 8b055bce27fe..b43defb9918c 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c | |||
@@ -358,6 +358,13 @@ static int axon_msi_probe(struct of_device *device, | |||
358 | goto out_free_msic; | 358 | goto out_free_msic; |
359 | } | 359 | } |
360 | 360 | ||
361 | virq = irq_of_parse_and_map(dn, 0); | ||
362 | if (virq == NO_IRQ) { | ||
363 | printk(KERN_ERR "axon_msi: irq parse and map failed for %s\n", | ||
364 | dn->full_name); | ||
365 | goto out_free_fifo; | ||
366 | } | ||
367 | |||
361 | msic->irq_host = irq_alloc_host(of_node_get(dn), IRQ_HOST_MAP_NOMAP, | 368 | msic->irq_host = irq_alloc_host(of_node_get(dn), IRQ_HOST_MAP_NOMAP, |
362 | NR_IRQS, &msic_host_ops, 0); | 369 | NR_IRQS, &msic_host_ops, 0); |
363 | if (!msic->irq_host) { | 370 | if (!msic->irq_host) { |
@@ -368,13 +375,6 @@ static int axon_msi_probe(struct of_device *device, | |||
368 | 375 | ||
369 | msic->irq_host->host_data = msic; | 376 | msic->irq_host->host_data = msic; |
370 | 377 | ||
371 | virq = irq_of_parse_and_map(dn, 0); | ||
372 | if (virq == NO_IRQ) { | ||
373 | printk(KERN_ERR "axon_msi: irq parse and map failed for %s\n", | ||
374 | dn->full_name); | ||
375 | goto out_free_host; | ||
376 | } | ||
377 | |||
378 | set_irq_data(virq, msic); | 378 | set_irq_data(virq, msic); |
379 | set_irq_chained_handler(virq, axon_msi_cascade); | 379 | set_irq_chained_handler(virq, axon_msi_cascade); |
380 | pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq); | 380 | pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq); |
@@ -399,8 +399,6 @@ static int axon_msi_probe(struct of_device *device, | |||
399 | 399 | ||
400 | return 0; | 400 | return 0; |
401 | 401 | ||
402 | out_free_host: | ||
403 | kfree(msic->irq_host); | ||
404 | out_free_fifo: | 402 | out_free_fifo: |
405 | dma_free_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES, msic->fifo_virt, | 403 | dma_free_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES, msic->fifo_virt, |
406 | msic->fifo_phys); | 404 | msic->fifo_phys); |