aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-01-21 01:12:30 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-03-02 00:50:24 -0500
commita9d8946b4af9e003c645ffb46489fdeb154e7ed9 (patch)
tree2094f6bc148232b8b02e0130675bcf8bb0cb37ca /arch
parent089fb442f3018a3ed094f8ac7a7cc2d3bd03b114 (diff)
powerpc: Use new irq allocator
Use the new functions and free the descriptor when the virq is destroyed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/irq.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 0531ccda8005..8a958ca26ac2 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -678,16 +678,15 @@ void irq_set_virq_count(unsigned int count)
678static int irq_setup_virq(struct irq_host *host, unsigned int virq, 678static int irq_setup_virq(struct irq_host *host, unsigned int virq,
679 irq_hw_number_t hwirq) 679 irq_hw_number_t hwirq)
680{ 680{
681 struct irq_desc *desc; 681 int res;
682 682
683 desc = irq_to_desc_alloc_node(virq, 0); 683 res = irq_alloc_desc_at(virq, 0);
684 if (!desc) { 684 if (res != virq) {
685 pr_debug("irq: -> allocating desc failed\n"); 685 pr_debug("irq: -> allocating desc failed\n");
686 goto error; 686 goto error;
687 } 687 }
688 688
689 /* Clear IRQ_NOREQUEST flag */ 689 irq_clear_status_flags(virq, IRQ_NOREQUEST);
690 desc->status &= ~IRQ_NOREQUEST;
691 690
692 /* map it */ 691 /* map it */
693 smp_wmb(); 692 smp_wmb();
@@ -696,11 +695,13 @@ static int irq_setup_virq(struct irq_host *host, unsigned int virq,
696 695
697 if (host->ops->map(host, virq, hwirq)) { 696 if (host->ops->map(host, virq, hwirq)) {
698 pr_debug("irq: -> mapping failed, freeing\n"); 697 pr_debug("irq: -> mapping failed, freeing\n");
699 goto error; 698 goto errdesc;
700 } 699 }
701 700
702 return 0; 701 return 0;
703 702
703errdesc:
704 irq_free_descs(virq, 1);
704error: 705error:
705 irq_free_virt(virq, 1); 706 irq_free_virt(virq, 1);
706 return -1; 707 return -1;
@@ -879,9 +880,9 @@ void irq_dispose_mapping(unsigned int virq)
879 smp_mb(); 880 smp_mb();
880 irq_map[virq].hwirq = host->inval_irq; 881 irq_map[virq].hwirq = host->inval_irq;
881 882
882 /* Set some flags */ 883 irq_set_status_flags(virq, IRQ_NOREQUEST);
883 irq_to_desc(virq)->status |= IRQ_NOREQUEST;
884 884
885 irq_free_descs(virq, 1);
885 /* Free it */ 886 /* Free it */
886 irq_free_virt(virq, 1); 887 irq_free_virt(virq, 1);
887} 888}