Commit c4318baf authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Paul Mundt

sh: Sanitize sparse irq

Switch over to the new allocator functions.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 2f98492c
...@@ -62,13 +62,13 @@ void register_ipr_controller(struct ipr_desc *desc) ...@@ -62,13 +62,13 @@ void register_ipr_controller(struct ipr_desc *desc)
for (i = 0; i < desc->nr_irqs; i++) { for (i = 0; i < desc->nr_irqs; i++) {
struct ipr_data *p = desc->ipr_data + i; struct ipr_data *p = desc->ipr_data + i;
struct irq_desc *irq_desc; int res;
BUG_ON(p->ipr_idx >= desc->nr_offsets); BUG_ON(p->ipr_idx >= desc->nr_offsets);
BUG_ON(!desc->ipr_offsets[p->ipr_idx]); BUG_ON(!desc->ipr_offsets[p->ipr_idx]);
irq_desc = irq_to_desc_alloc_node(p->irq, numa_node_id()); res = irq_alloc_desc_at(p->irq, numa_node_id());
if (unlikely(!irq_desc)) { if (unlikely(res != p->irq && res != -EEXIST))
printk(KERN_INFO "can not get irq_desc for %d\n", printk(KERN_INFO "can not get irq_desc for %d\n",
p->irq); p->irq);
continue; continue;
......
...@@ -300,13 +300,13 @@ int __init register_intc_controller(struct intc_desc *desc) ...@@ -300,13 +300,13 @@ int __init register_intc_controller(struct intc_desc *desc)
for (i = 0; i < hw->nr_vectors; i++) { for (i = 0; i < hw->nr_vectors; i++) {
struct intc_vect *vect = hw->vectors + i; struct intc_vect *vect = hw->vectors + i;
unsigned int irq = evt2irq(vect->vect); unsigned int irq = evt2irq(vect->vect);
struct irq_desc *irq_desc; int res;
if (!vect->enum_id) if (!vect->enum_id)
continue; continue;
irq_desc = irq_to_desc_alloc_node(irq, numa_node_id()); res = irq_alloc_desc_at(irq, numa_node_id());
if (unlikely(!irq_desc)) { if (res != irq && res != -EEXIST) {
pr_err("can't get irq_desc for %d\n", irq); pr_err("can't get irq_desc for %d\n", irq);
continue; continue;
} }
...@@ -326,8 +326,8 @@ int __init register_intc_controller(struct intc_desc *desc) ...@@ -326,8 +326,8 @@ int __init register_intc_controller(struct intc_desc *desc)
* IRQ support, each vector still needs to have * IRQ support, each vector still needs to have
* its own backing irq_desc. * its own backing irq_desc.
*/ */
irq_desc = irq_to_desc_alloc_node(irq2, numa_node_id()); res = irq_alloc_desc_at(irq2, numa_node_id());
if (unlikely(!irq_desc)) { if (res != irq2 && res != -EEXIST) {
pr_err("can't get irq_desc for %d\n", irq2); pr_err("can't get irq_desc for %d\n", irq2);
continue; continue;
} }
......
...@@ -37,7 +37,6 @@ unsigned int create_irq_nr(unsigned int irq_want, int node) ...@@ -37,7 +37,6 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
{ {
unsigned int irq = 0, new; unsigned int irq = 0, new;
unsigned long flags; unsigned long flags;
struct irq_desc *desc;
raw_spin_lock_irqsave(&vector_lock, flags); raw_spin_lock_irqsave(&vector_lock, flags);
...@@ -55,24 +54,20 @@ unsigned int create_irq_nr(unsigned int irq_want, int node) ...@@ -55,24 +54,20 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
__set_bit(new, intc_irq_map); __set_bit(new, intc_irq_map);
} }
desc = irq_to_desc_alloc_node(new, node); raw_spin_unlock_irqrestore(&vector_lock, flags);
if (unlikely(!desc)) {
irq = irq_alloc_desc_at(new, node);
if (unlikely(irq != new)) {
pr_err("can't get irq_desc for %d\n", new); pr_err("can't get irq_desc for %d\n", new);
goto out_unlock; return 0;
} }
desc = move_irq_desc(desc, node); activate_irq(irq);
irq = new; return 0;
out_unlock: out_unlock:
raw_spin_unlock_irqrestore(&vector_lock, flags); raw_spin_unlock_irqrestore(&vector_lock, flags);
return 0;
if (irq > 0) {
dynamic_irq_init(irq);
activate_irq(irq);
}
return irq;
} }
int create_irq(void) int create_irq(void)
...@@ -91,7 +86,7 @@ void destroy_irq(unsigned int irq) ...@@ -91,7 +86,7 @@ void destroy_irq(unsigned int irq)
{ {
unsigned long flags; unsigned long flags;
dynamic_irq_cleanup(irq); irq_free_desc(irq);
raw_spin_lock_irqsave(&vector_lock, flags); raw_spin_lock_irqsave(&vector_lock, flags);
__clear_bit(irq, intc_irq_map); __clear_bit(irq, intc_irq_map);
......
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