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/emma2rh/common | |
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/emma2rh/common')
-rw-r--r-- | arch/mips/emma2rh/common/irq_emma2rh.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/arch/mips/emma2rh/common/irq_emma2rh.c b/arch/mips/emma2rh/common/irq_emma2rh.c index 197ed4c2ba04..bf1b83ba925e 100644 --- a/arch/mips/emma2rh/common/irq_emma2rh.c +++ b/arch/mips/emma2rh/common/irq_emma2rh.c | |||
@@ -56,22 +56,6 @@ static void emma2rh_irq_disable(unsigned int irq) | |||
56 | ll_emma2rh_irq_disable(irq - emma2rh_irq_base); | 56 | ll_emma2rh_irq_disable(irq - emma2rh_irq_base); |
57 | } | 57 | } |
58 | 58 | ||
59 | static unsigned int emma2rh_irq_startup(unsigned int irq) | ||
60 | { | ||
61 | emma2rh_irq_enable(irq); | ||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | #define emma2rh_irq_shutdown emma2rh_irq_disable | ||
66 | |||
67 | static void emma2rh_irq_ack(unsigned int irq) | ||
68 | { | ||
69 | /* disable interrupt - some handler will re-enable the irq | ||
70 | * and if the interrupt is leveled, we will have infinite loop | ||
71 | */ | ||
72 | ll_emma2rh_irq_disable(irq - emma2rh_irq_base); | ||
73 | } | ||
74 | |||
75 | static void emma2rh_irq_end(unsigned int irq) | 59 | static void emma2rh_irq_end(unsigned int irq) |
76 | { | 60 | { |
77 | if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) | 61 | if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) |
@@ -80,25 +64,19 @@ static void emma2rh_irq_end(unsigned int irq) | |||
80 | 64 | ||
81 | struct irq_chip emma2rh_irq_controller = { | 65 | struct irq_chip emma2rh_irq_controller = { |
82 | .typename = "emma2rh_irq", | 66 | .typename = "emma2rh_irq", |
83 | .startup = emma2rh_irq_startup, | 67 | .ack = emma2rh_irq_disable, |
84 | .shutdown = emma2rh_irq_shutdown, | 68 | .mask = emma2rh_irq_disable, |
85 | .enable = emma2rh_irq_enable, | 69 | .mask_ack = emma2rh_irq_disable, |
86 | .disable = emma2rh_irq_disable, | 70 | .unmask = emma2rh_irq_enable, |
87 | .ack = emma2rh_irq_ack, | ||
88 | .end = emma2rh_irq_end, | 71 | .end = emma2rh_irq_end, |
89 | .set_affinity = NULL /* no affinity stuff for UP */ | ||
90 | }; | 72 | }; |
91 | 73 | ||
92 | void emma2rh_irq_init(u32 irq_base) | 74 | void emma2rh_irq_init(u32 irq_base) |
93 | { | 75 | { |
94 | u32 i; | 76 | u32 i; |
95 | 77 | ||
96 | for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ; i++) { | 78 | for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ; i++) |
97 | irq_desc[i].status = IRQ_DISABLED; | 79 | set_irq_chip(i, &emma2rh_irq_controller); |
98 | irq_desc[i].action = NULL; | ||
99 | irq_desc[i].depth = 1; | ||
100 | irq_desc[i].chip = &emma2rh_irq_controller; | ||
101 | } | ||
102 | 80 | ||
103 | emma2rh_irq_base = irq_base; | 81 | emma2rh_irq_base = irq_base; |
104 | } | 82 | } |