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/lasat/interrupt.c | |
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/lasat/interrupt.c')
-rw-r--r-- | arch/mips/lasat/interrupt.c | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c index a144a002dcc4..cac82afe5eb4 100644 --- a/arch/mips/lasat/interrupt.c +++ b/arch/mips/lasat/interrupt.c | |||
@@ -36,33 +36,14 @@ static volatile int lasat_int_mask_shift; | |||
36 | 36 | ||
37 | void disable_lasat_irq(unsigned int irq_nr) | 37 | void disable_lasat_irq(unsigned int irq_nr) |
38 | { | 38 | { |
39 | unsigned long flags; | ||
40 | |||
41 | local_irq_save(flags); | ||
42 | *lasat_int_mask &= ~(1 << irq_nr) << lasat_int_mask_shift; | 39 | *lasat_int_mask &= ~(1 << irq_nr) << lasat_int_mask_shift; |
43 | local_irq_restore(flags); | ||
44 | } | 40 | } |
45 | 41 | ||
46 | void enable_lasat_irq(unsigned int irq_nr) | 42 | void enable_lasat_irq(unsigned int irq_nr) |
47 | { | 43 | { |
48 | unsigned long flags; | ||
49 | |||
50 | local_irq_save(flags); | ||
51 | *lasat_int_mask |= (1 << irq_nr) << lasat_int_mask_shift; | 44 | *lasat_int_mask |= (1 << irq_nr) << lasat_int_mask_shift; |
52 | local_irq_restore(flags); | ||
53 | } | 45 | } |
54 | 46 | ||
55 | static unsigned int startup_lasat_irq(unsigned int irq) | ||
56 | { | ||
57 | enable_lasat_irq(irq); | ||
58 | |||
59 | return 0; /* never anything pending */ | ||
60 | } | ||
61 | |||
62 | #define shutdown_lasat_irq disable_lasat_irq | ||
63 | |||
64 | #define mask_and_ack_lasat_irq disable_lasat_irq | ||
65 | |||
66 | static void end_lasat_irq(unsigned int irq) | 47 | static void end_lasat_irq(unsigned int irq) |
67 | { | 48 | { |
68 | if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) | 49 | if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) |
@@ -71,11 +52,10 @@ static void end_lasat_irq(unsigned int irq) | |||
71 | 52 | ||
72 | static struct irq_chip lasat_irq_type = { | 53 | static struct irq_chip lasat_irq_type = { |
73 | .typename = "Lasat", | 54 | .typename = "Lasat", |
74 | .startup = startup_lasat_irq, | 55 | .ack = disable_lasat_irq, |
75 | .shutdown = shutdown_lasat_irq, | 56 | .mask = disable_lasat_irq, |
76 | .enable = enable_lasat_irq, | 57 | .mask_ack = disable_lasat_irq, |
77 | .disable = disable_lasat_irq, | 58 | .unmask = enable_lasat_irq, |
78 | .ack = mask_and_ack_lasat_irq, | ||
79 | .end = end_lasat_irq, | 59 | .end = end_lasat_irq, |
80 | }; | 60 | }; |
81 | 61 | ||
@@ -152,10 +132,6 @@ void __init arch_init_irq(void) | |||
152 | panic("arch_init_irq: mips_machtype incorrect"); | 132 | panic("arch_init_irq: mips_machtype incorrect"); |
153 | } | 133 | } |
154 | 134 | ||
155 | for (i = 0; i <= LASATINT_END; i++) { | 135 | for (i = 0; i <= LASATINT_END; i++) |
156 | irq_desc[i].status = IRQ_DISABLED; | 136 | set_irq_chip(i, &lasat_irq_type); |
157 | irq_desc[i].action = 0; | ||
158 | irq_desc[i].depth = 1; | ||
159 | irq_desc[i].chip = &lasat_irq_type; | ||
160 | } | ||
161 | } | 137 | } |