diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-11-01 12:08:36 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-11-29 20:14:46 -0500 |
commit | 1603b5aca4f15b34848fb5594d0c7b6333b99144 (patch) | |
tree | 79272aa41d6510b7256df62e287676885c3960cf /arch/mips/sibyte/sb1250 | |
parent | c87b6ebaea034c0e0ce86127870cf1511a307b64 (diff) |
[MIPS] IRQ cleanups
This is a big irq cleanup patch.
* Use set_irq_chip() to register irq_chip.
* Initialize .mask, .unmask, .mask_ack field. Functions for these
method are already exist in most case.
* Do not initialize .startup, .shutdown, .enable, .disable fields if
default routines provided by irq_chip_set_defaults() were suitable.
* Remove redundant irq_desc initializations.
* Remove unnecessary local_irq_save/local_irq_restore, spin_lock.
With this cleanup, it would be easy to switch to slightly lightwait
irq flow handlers (handle_level_irq(), etc.) instead of __do_IRQ().
Though whole this patch is quite large, changes in each irq_chip are
not quite simple. Please review and test on your platform. Thanks.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/sibyte/sb1250')
-rw-r--r-- | arch/mips/sibyte/sb1250/irq.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index d5d26770daf6..82ce7533053f 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c | |||
@@ -44,11 +44,9 @@ | |||
44 | */ | 44 | */ |
45 | 45 | ||
46 | 46 | ||
47 | #define shutdown_sb1250_irq disable_sb1250_irq | ||
48 | static void end_sb1250_irq(unsigned int irq); | 47 | static void end_sb1250_irq(unsigned int irq); |
49 | static void enable_sb1250_irq(unsigned int irq); | 48 | static void enable_sb1250_irq(unsigned int irq); |
50 | static void disable_sb1250_irq(unsigned int irq); | 49 | static void disable_sb1250_irq(unsigned int irq); |
51 | static unsigned int startup_sb1250_irq(unsigned int irq); | ||
52 | static void ack_sb1250_irq(unsigned int irq); | 50 | static void ack_sb1250_irq(unsigned int irq); |
53 | #ifdef CONFIG_SMP | 51 | #ifdef CONFIG_SMP |
54 | static void sb1250_set_affinity(unsigned int irq, cpumask_t mask); | 52 | static void sb1250_set_affinity(unsigned int irq, cpumask_t mask); |
@@ -70,11 +68,10 @@ extern char sb1250_duart_present[]; | |||
70 | 68 | ||
71 | static struct irq_chip sb1250_irq_type = { | 69 | static struct irq_chip sb1250_irq_type = { |
72 | .typename = "SB1250-IMR", | 70 | .typename = "SB1250-IMR", |
73 | .startup = startup_sb1250_irq, | ||
74 | .shutdown = shutdown_sb1250_irq, | ||
75 | .enable = enable_sb1250_irq, | ||
76 | .disable = disable_sb1250_irq, | ||
77 | .ack = ack_sb1250_irq, | 71 | .ack = ack_sb1250_irq, |
72 | .mask = disable_sb1250_irq, | ||
73 | .mask_ack = ack_sb1250_irq, | ||
74 | .unmask = enable_sb1250_irq, | ||
78 | .end = end_sb1250_irq, | 75 | .end = end_sb1250_irq, |
79 | #ifdef CONFIG_SMP | 76 | #ifdef CONFIG_SMP |
80 | .set_affinity = sb1250_set_affinity | 77 | .set_affinity = sb1250_set_affinity |
@@ -163,14 +160,6 @@ static void sb1250_set_affinity(unsigned int irq, cpumask_t mask) | |||
163 | 160 | ||
164 | /*****************************************************************************/ | 161 | /*****************************************************************************/ |
165 | 162 | ||
166 | static unsigned int startup_sb1250_irq(unsigned int irq) | ||
167 | { | ||
168 | sb1250_unmask_irq(sb1250_irq_owner[irq], irq); | ||
169 | |||
170 | return 0; /* never anything pending */ | ||
171 | } | ||
172 | |||
173 | |||
174 | static void disable_sb1250_irq(unsigned int irq) | 163 | static void disable_sb1250_irq(unsigned int irq) |
175 | { | 164 | { |
176 | sb1250_mask_irq(sb1250_irq_owner[irq], irq); | 165 | sb1250_mask_irq(sb1250_irq_owner[irq], irq); |
@@ -239,16 +228,9 @@ void __init init_sb1250_irqs(void) | |||
239 | { | 228 | { |
240 | int i; | 229 | int i; |
241 | 230 | ||
242 | for (i = 0; i < NR_IRQS; i++) { | 231 | for (i = 0; i < SB1250_NR_IRQS; i++) { |
243 | irq_desc[i].status = IRQ_DISABLED; | 232 | set_irq_chip(i, &sb1250_irq_type); |
244 | irq_desc[i].action = 0; | 233 | sb1250_irq_owner[i] = 0; |
245 | irq_desc[i].depth = 1; | ||
246 | if (i < SB1250_NR_IRQS) { | ||
247 | irq_desc[i].chip = &sb1250_irq_type; | ||
248 | sb1250_irq_owner[i] = 0; | ||
249 | } else { | ||
250 | irq_desc[i].chip = &no_irq_chip; | ||
251 | } | ||
252 | } | 234 | } |
253 | } | 235 | } |
254 | 236 | ||