aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh/intc/dynamic.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-10-11 13:03:09 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-10-26 02:01:52 -0400
commitc4318baf00ed24b7fdcc255de33a18ab37ee8606 (patch)
tree2bf80722d2e7236de917e0e577fb14233e58e513 /drivers/sh/intc/dynamic.c
parent2f98492c5375e906e48c78d88351f45bb11b6a8a (diff)
sh: Sanitize sparse irq
Switch over to the new allocator functions. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh/intc/dynamic.c')
-rw-r--r--drivers/sh/intc/dynamic.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/sh/intc/dynamic.c b/drivers/sh/intc/dynamic.c
index 6caecdffe201..e994c7ed916e 100644
--- a/drivers/sh/intc/dynamic.c
+++ b/drivers/sh/intc/dynamic.c
@@ -37,7 +37,6 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
37{ 37{
38 unsigned int irq = 0, new; 38 unsigned int irq = 0, new;
39 unsigned long flags; 39 unsigned long flags;
40 struct irq_desc *desc;
41 40
42 raw_spin_lock_irqsave(&vector_lock, flags); 41 raw_spin_lock_irqsave(&vector_lock, flags);
43 42
@@ -55,24 +54,20 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
55 __set_bit(new, intc_irq_map); 54 __set_bit(new, intc_irq_map);
56 } 55 }
57 56
58 desc = irq_to_desc_alloc_node(new, node); 57 raw_spin_unlock_irqrestore(&vector_lock, flags);
59 if (unlikely(!desc)) { 58
59 irq = irq_alloc_desc_at(new, node);
60 if (unlikely(irq != new)) {
60 pr_err("can't get irq_desc for %d\n", new); 61 pr_err("can't get irq_desc for %d\n", new);
61 goto out_unlock; 62 return 0;
62 } 63 }
63 64
64 desc = move_irq_desc(desc, node); 65 activate_irq(irq);
65 irq = new; 66 return 0;
66 67
67out_unlock: 68out_unlock:
68 raw_spin_unlock_irqrestore(&vector_lock, flags); 69 raw_spin_unlock_irqrestore(&vector_lock, flags);
69 70 return 0;
70 if (irq > 0) {
71 dynamic_irq_init(irq);
72 activate_irq(irq);
73 }
74
75 return irq;
76} 71}
77 72
78int create_irq(void) 73int create_irq(void)
@@ -91,7 +86,7 @@ void destroy_irq(unsigned int irq)
91{ 86{
92 unsigned long flags; 87 unsigned long flags;
93 88
94 dynamic_irq_cleanup(irq); 89 irq_free_desc(irq);
95 90
96 raw_spin_lock_irqsave(&vector_lock, flags); 91 raw_spin_lock_irqsave(&vector_lock, flags);
97 __clear_bit(irq, intc_irq_map); 92 __clear_bit(irq, intc_irq_map);