Commit a9d8946b authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Benjamin Herrenschmidt

powerpc: Use new irq allocator

Use the new functions and free the descriptor when the virq is
destroyed.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 089fb442
...@@ -678,16 +678,15 @@ void irq_set_virq_count(unsigned int count) ...@@ -678,16 +678,15 @@ void irq_set_virq_count(unsigned int count)
static int irq_setup_virq(struct irq_host *host, unsigned int virq, static int irq_setup_virq(struct irq_host *host, unsigned int virq,
irq_hw_number_t hwirq) irq_hw_number_t hwirq)
{ {
struct irq_desc *desc; int res;
desc = irq_to_desc_alloc_node(virq, 0); res = irq_alloc_desc_at(virq, 0);
if (!desc) { if (res != virq) {
pr_debug("irq: -> allocating desc failed\n"); pr_debug("irq: -> allocating desc failed\n");
goto error; goto error;
} }
/* Clear IRQ_NOREQUEST flag */ irq_clear_status_flags(virq, IRQ_NOREQUEST);
desc->status &= ~IRQ_NOREQUEST;
/* map it */ /* map it */
smp_wmb(); smp_wmb();
...@@ -696,11 +695,13 @@ static int irq_setup_virq(struct irq_host *host, unsigned int virq, ...@@ -696,11 +695,13 @@ static int irq_setup_virq(struct irq_host *host, unsigned int virq,
if (host->ops->map(host, virq, hwirq)) { if (host->ops->map(host, virq, hwirq)) {
pr_debug("irq: -> mapping failed, freeing\n"); pr_debug("irq: -> mapping failed, freeing\n");
goto error; goto errdesc;
} }
return 0; return 0;
errdesc:
irq_free_descs(virq, 1);
error: error:
irq_free_virt(virq, 1); irq_free_virt(virq, 1);
return -1; return -1;
...@@ -879,9 +880,9 @@ void irq_dispose_mapping(unsigned int virq) ...@@ -879,9 +880,9 @@ void irq_dispose_mapping(unsigned int virq)
smp_mb(); smp_mb();
irq_map[virq].hwirq = host->inval_irq; irq_map[virq].hwirq = host->inval_irq;
/* Set some flags */ irq_set_status_flags(virq, IRQ_NOREQUEST);
irq_to_desc(virq)->status |= IRQ_NOREQUEST;
irq_free_descs(virq, 1);
/* Free it */ /* Free it */
irq_free_virt(virq, 1); irq_free_virt(virq, 1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment