diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-04-13 16:31:28 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-11-08 16:35:47 -0500 |
commit | c288bf2533e57174b90b07860c4391bcd1ea269c (patch) | |
tree | 91fa6ef91d6653f491f41ff97c4da5e28dfd62fe /arch | |
parent | 3ec7215e5d1a714ef65069a1d0999a31e4930bb7 (diff) |
m68k/irq: Rename irq_controller to irq_chip
Make it more similar to the genirq version:
- Remove lock (unused as we don't do SMP anyway),
- Prepend methods with irq_,
- Make irq_startup() return unsigned int.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/m68k/amiga/amiints.c | 9 | ||||
-rw-r--r-- | arch/m68k/amiga/cia.c | 18 | ||||
-rw-r--r-- | arch/m68k/apollo/dn_ints.c | 11 | ||||
-rw-r--r-- | arch/m68k/atari/ataints.c | 15 | ||||
-rw-r--r-- | arch/m68k/include/asm/irq.h | 15 | ||||
-rw-r--r-- | arch/m68k/kernel/ints.c | 86 | ||||
-rw-r--r-- | arch/m68k/mac/macints.c | 9 | ||||
-rw-r--r-- | arch/m68k/q40/q40ints.c | 17 | ||||
-rw-r--r-- | arch/m68k/sun3/sun3ints.c | 13 |
9 files changed, 91 insertions, 102 deletions
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c index c5b5212cc3f9..320c5d048dc7 100644 --- a/arch/m68k/amiga/amiints.c +++ b/arch/m68k/amiga/amiints.c | |||
@@ -52,11 +52,10 @@ static irqreturn_t ami_int3(int irq, void *dev_id); | |||
52 | static irqreturn_t ami_int4(int irq, void *dev_id); | 52 | static irqreturn_t ami_int4(int irq, void *dev_id); |
53 | static irqreturn_t ami_int5(int irq, void *dev_id); | 53 | static irqreturn_t ami_int5(int irq, void *dev_id); |
54 | 54 | ||
55 | static struct irq_controller amiga_irq_controller = { | 55 | static struct irq_chip amiga_irq_chip = { |
56 | .name = "amiga", | 56 | .name = "amiga", |
57 | .lock = __SPIN_LOCK_UNLOCKED(amiga_irq_controller.lock), | 57 | .irq_enable = amiga_enable_irq, |
58 | .enable = amiga_enable_irq, | 58 | .irq_disable = amiga_disable_irq, |
59 | .disable = amiga_disable_irq, | ||
60 | }; | 59 | }; |
61 | 60 | ||
62 | /* | 61 | /* |
@@ -81,7 +80,7 @@ void __init amiga_init_IRQ(void) | |||
81 | if (request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL)) | 80 | if (request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL)) |
82 | pr_err("Couldn't register int%d\n", 5); | 81 | pr_err("Couldn't register int%d\n", 5); |
83 | 82 | ||
84 | m68k_setup_irq_controller(&amiga_irq_controller, IRQ_USER, AMI_STD_IRQS); | 83 | m68k_setup_irq_chip(&amiga_irq_chip, IRQ_USER, AMI_STD_IRQS); |
85 | 84 | ||
86 | /* turn off PCMCIA interrupts */ | 85 | /* turn off PCMCIA interrupts */ |
87 | if (AMIGAHW_PRESENT(PCMCIA)) | 86 | if (AMIGAHW_PRESENT(PCMCIA)) |
diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c index ecd0f7ca6f0e..637ef53112b6 100644 --- a/arch/m68k/amiga/cia.c +++ b/arch/m68k/amiga/cia.c | |||
@@ -121,11 +121,10 @@ static void cia_disable_irq(unsigned int irq) | |||
121 | cia_able_irq(&ciaa_base, 1 << (irq - IRQ_AMIGA_CIAA)); | 121 | cia_able_irq(&ciaa_base, 1 << (irq - IRQ_AMIGA_CIAA)); |
122 | } | 122 | } |
123 | 123 | ||
124 | static struct irq_controller cia_irq_controller = { | 124 | static struct irq_chip cia_irq_chip = { |
125 | .name = "cia", | 125 | .name = "cia", |
126 | .lock = __SPIN_LOCK_UNLOCKED(cia_irq_controller.lock), | 126 | .irq_enable = cia_enable_irq, |
127 | .enable = cia_enable_irq, | 127 | .irq_disable = cia_disable_irq, |
128 | .disable = cia_disable_irq, | ||
129 | }; | 128 | }; |
130 | 129 | ||
131 | /* | 130 | /* |
@@ -158,23 +157,22 @@ static void auto_disable_irq(unsigned int irq) | |||
158 | } | 157 | } |
159 | } | 158 | } |
160 | 159 | ||
161 | static struct irq_controller auto_irq_controller = { | 160 | static struct irq_chip auto_irq_chip = { |
162 | .name = "auto", | 161 | .name = "auto", |
163 | .lock = __SPIN_LOCK_UNLOCKED(auto_irq_controller.lock), | 162 | .irq_enable = auto_enable_irq, |
164 | .enable = auto_enable_irq, | 163 | .irq_disable = auto_disable_irq, |
165 | .disable = auto_disable_irq, | ||
166 | }; | 164 | }; |
167 | 165 | ||
168 | void __init cia_init_IRQ(struct ciabase *base) | 166 | void __init cia_init_IRQ(struct ciabase *base) |
169 | { | 167 | { |
170 | m68k_setup_irq_controller(&cia_irq_controller, base->cia_irq, CIA_IRQS); | 168 | m68k_setup_irq_chip(&cia_irq_chip, base->cia_irq, CIA_IRQS); |
171 | 169 | ||
172 | /* clear any pending interrupt and turn off all interrupts */ | 170 | /* clear any pending interrupt and turn off all interrupts */ |
173 | cia_set_irq(base, CIA_ICR_ALL); | 171 | cia_set_irq(base, CIA_ICR_ALL); |
174 | cia_able_irq(base, CIA_ICR_ALL); | 172 | cia_able_irq(base, CIA_ICR_ALL); |
175 | 173 | ||
176 | /* override auto int and install CIA handler */ | 174 | /* override auto int and install CIA handler */ |
177 | m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1); | 175 | m68k_setup_irq_chip(&auto_irq_chip, base->handler_irq, 1); |
178 | m68k_irq_startup(base->handler_irq); | 176 | m68k_irq_startup(base->handler_irq); |
179 | if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED, | 177 | if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED, |
180 | base->name, base)) | 178 | base->name, base)) |
diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c index 5d47f3aa3810..d6e8f33466be 100644 --- a/arch/m68k/apollo/dn_ints.c +++ b/arch/m68k/apollo/dn_ints.c | |||
@@ -12,7 +12,7 @@ void dn_process_int(unsigned int irq, struct pt_regs *fp) | |||
12 | *(volatile unsigned char *)(picb)=0x20; | 12 | *(volatile unsigned char *)(picb)=0x20; |
13 | } | 13 | } |
14 | 14 | ||
15 | int apollo_irq_startup(unsigned int irq) | 15 | unsigned int apollo_irq_startup(unsigned int irq) |
16 | { | 16 | { |
17 | if (irq < 8) | 17 | if (irq < 8) |
18 | *(volatile unsigned char *)(pica+1) &= ~(1 << irq); | 18 | *(volatile unsigned char *)(pica+1) &= ~(1 << irq); |
@@ -29,16 +29,15 @@ void apollo_irq_shutdown(unsigned int irq) | |||
29 | *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8)); | 29 | *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8)); |
30 | } | 30 | } |
31 | 31 | ||
32 | static struct irq_controller apollo_irq_controller = { | 32 | static struct irq_chip apollo_irq_chip = { |
33 | .name = "apollo", | 33 | .name = "apollo", |
34 | .lock = __SPIN_LOCK_UNLOCKED(apollo_irq_controller.lock), | 34 | .irq_startup = apollo_irq_startup, |
35 | .startup = apollo_irq_startup, | 35 | .irq_shutdown = apollo_irq_shutdown, |
36 | .shutdown = apollo_irq_shutdown, | ||
37 | }; | 36 | }; |
38 | 37 | ||
39 | 38 | ||
40 | void __init dn_init_IRQ(void) | 39 | void __init dn_init_IRQ(void) |
41 | { | 40 | { |
42 | m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int); | 41 | m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int); |
43 | m68k_setup_irq_controller(&apollo_irq_controller, IRQ_APOLLO, 16); | 42 | m68k_setup_irq_chip(&apollo_irq_chip, IRQ_APOLLO, 16); |
44 | } | 43 | } |
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index 26a804e67bce..ac0ebdf6ca72 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c | |||
@@ -320,7 +320,7 @@ extern void atari_microwire_cmd(int cmd); | |||
320 | 320 | ||
321 | extern int atari_SCC_reset_done; | 321 | extern int atari_SCC_reset_done; |
322 | 322 | ||
323 | static int atari_startup_irq(unsigned int irq) | 323 | static unsigned int atari_startup_irq(unsigned int irq) |
324 | { | 324 | { |
325 | m68k_irq_startup(irq); | 325 | m68k_irq_startup(irq); |
326 | atari_turnon_irq(irq); | 326 | atari_turnon_irq(irq); |
@@ -338,13 +338,12 @@ static void atari_shutdown_irq(unsigned int irq) | |||
338 | vectors[VEC_INT4] = falcon_hblhandler; | 338 | vectors[VEC_INT4] = falcon_hblhandler; |
339 | } | 339 | } |
340 | 340 | ||
341 | static struct irq_controller atari_irq_controller = { | 341 | static struct irq_chip atari_irq_chip = { |
342 | .name = "atari", | 342 | .name = "atari", |
343 | .lock = __SPIN_LOCK_UNLOCKED(atari_irq_controller.lock), | 343 | .irq_startup = atari_startup_irq, |
344 | .startup = atari_startup_irq, | 344 | .irq_shutdown = atari_shutdown_irq, |
345 | .shutdown = atari_shutdown_irq, | 345 | .irq_enable = atari_enable_irq, |
346 | .enable = atari_enable_irq, | 346 | .irq_disable = atari_disable_irq, |
347 | .disable = atari_disable_irq, | ||
348 | }; | 347 | }; |
349 | 348 | ||
350 | /* | 349 | /* |
@@ -361,7 +360,7 @@ static struct irq_controller atari_irq_controller = { | |||
361 | void __init atari_init_IRQ(void) | 360 | void __init atari_init_IRQ(void) |
362 | { | 361 | { |
363 | m68k_setup_user_interrupt(VEC_USER, NUM_ATARI_SOURCES - IRQ_USER, NULL); | 362 | m68k_setup_user_interrupt(VEC_USER, NUM_ATARI_SOURCES - IRQ_USER, NULL); |
364 | m68k_setup_irq_controller(&atari_irq_controller, 1, NUM_ATARI_SOURCES - 1); | 363 | m68k_setup_irq_chip(&atari_irq_chip, 1, NUM_ATARI_SOURCES - 1); |
365 | 364 | ||
366 | /* Initialize the MFP(s) */ | 365 | /* Initialize the MFP(s) */ |
367 | 366 | ||
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h index 69ed0d74d532..d8c6f68b7a78 100644 --- a/arch/m68k/include/asm/irq.h +++ b/arch/m68k/include/asm/irq.h | |||
@@ -93,16 +93,15 @@ struct irq_handler { | |||
93 | const char *devname; | 93 | const char *devname; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | struct irq_controller { | 96 | struct irq_chip { |
97 | const char *name; | 97 | const char *name; |
98 | spinlock_t lock; | 98 | unsigned int (*irq_startup)(unsigned int irq); |
99 | int (*startup)(unsigned int irq); | 99 | void (*irq_shutdown)(unsigned int irq); |
100 | void (*shutdown)(unsigned int irq); | 100 | void (*irq_enable)(unsigned int irq); |
101 | void (*enable)(unsigned int irq); | 101 | void (*irq_disable)(unsigned int irq); |
102 | void (*disable)(unsigned int irq); | ||
103 | }; | 102 | }; |
104 | 103 | ||
105 | extern int m68k_irq_startup(unsigned int); | 104 | extern unsigned int m68k_irq_startup(unsigned int); |
106 | extern void m68k_irq_shutdown(unsigned int); | 105 | extern void m68k_irq_shutdown(unsigned int); |
107 | 106 | ||
108 | /* | 107 | /* |
@@ -113,7 +112,7 @@ extern irq_node_t *new_irq_node(void); | |||
113 | extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *)); | 112 | extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *)); |
114 | extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, | 113 | extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, |
115 | void (*handler)(unsigned int, struct pt_regs *)); | 114 | void (*handler)(unsigned int, struct pt_regs *)); |
116 | extern void m68k_setup_irq_controller(struct irq_controller *, unsigned int, unsigned int); | 115 | extern void m68k_setup_irq_chip(struct irq_chip *, unsigned int, unsigned int); |
117 | 116 | ||
118 | asmlinkage void m68k_handle_int(unsigned int); | 117 | asmlinkage void m68k_handle_int(unsigned int); |
119 | asmlinkage void __m68k_handle_int(unsigned int, struct pt_regs *); | 118 | asmlinkage void __m68k_handle_int(unsigned int, struct pt_regs *); |
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c index 761ee0440c99..f43ad7b93ab6 100644 --- a/arch/m68k/kernel/ints.c +++ b/arch/m68k/kernel/ints.c | |||
@@ -52,23 +52,21 @@ extern u16 user_irqvec_fixup[]; | |||
52 | 52 | ||
53 | /* table for system interrupt handlers */ | 53 | /* table for system interrupt handlers */ |
54 | static struct irq_node *irq_list[NR_IRQS]; | 54 | static struct irq_node *irq_list[NR_IRQS]; |
55 | static struct irq_controller *irq_controller[NR_IRQS]; | 55 | static struct irq_chip *irq_chip[NR_IRQS]; |
56 | static int irq_depth[NR_IRQS]; | 56 | static int irq_depth[NR_IRQS]; |
57 | 57 | ||
58 | static int m68k_first_user_vec; | 58 | static int m68k_first_user_vec; |
59 | 59 | ||
60 | static struct irq_controller auto_irq_controller = { | 60 | static struct irq_chip auto_irq_chip = { |
61 | .name = "auto", | 61 | .name = "auto", |
62 | .lock = __SPIN_LOCK_UNLOCKED(auto_irq_controller.lock), | 62 | .irq_startup = m68k_irq_startup, |
63 | .startup = m68k_irq_startup, | 63 | .irq_shutdown = m68k_irq_shutdown, |
64 | .shutdown = m68k_irq_shutdown, | ||
65 | }; | 64 | }; |
66 | 65 | ||
67 | static struct irq_controller user_irq_controller = { | 66 | static struct irq_chip user_irq_chip = { |
68 | .name = "user", | 67 | .name = "user", |
69 | .lock = __SPIN_LOCK_UNLOCKED(user_irq_controller.lock), | 68 | .irq_startup = m68k_irq_startup, |
70 | .startup = m68k_irq_startup, | 69 | .irq_shutdown = m68k_irq_shutdown, |
71 | .shutdown = m68k_irq_shutdown, | ||
72 | }; | 70 | }; |
73 | 71 | ||
74 | #define NUM_IRQ_NODES 100 | 72 | #define NUM_IRQ_NODES 100 |
@@ -96,7 +94,7 @@ void __init init_IRQ(void) | |||
96 | } | 94 | } |
97 | 95 | ||
98 | for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++) | 96 | for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++) |
99 | irq_controller[i] = &auto_irq_controller; | 97 | irq_chip[i] = &auto_irq_chip; |
100 | 98 | ||
101 | mach_init_IRQ(); | 99 | mach_init_IRQ(); |
102 | } | 100 | } |
@@ -136,7 +134,7 @@ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, | |||
136 | BUG_ON(IRQ_USER + cnt > NR_IRQS); | 134 | BUG_ON(IRQ_USER + cnt > NR_IRQS); |
137 | m68k_first_user_vec = vec; | 135 | m68k_first_user_vec = vec; |
138 | for (i = 0; i < cnt; i++) | 136 | for (i = 0; i < cnt; i++) |
139 | irq_controller[IRQ_USER + i] = &user_irq_controller; | 137 | irq_chip[IRQ_USER + i] = &user_irq_chip; |
140 | *user_irqvec_fixup = vec - IRQ_USER; | 138 | *user_irqvec_fixup = vec - IRQ_USER; |
141 | if (handler) | 139 | if (handler) |
142 | *user_irqhandler_fixup = (u32)handler; | 140 | *user_irqhandler_fixup = (u32)handler; |
@@ -144,7 +142,7 @@ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, | |||
144 | } | 142 | } |
145 | 143 | ||
146 | /** | 144 | /** |
147 | * m68k_setup_irq_controller | 145 | * m68k_setup_irq_chip |
148 | * @contr: irq controller which controls specified irq | 146 | * @contr: irq controller which controls specified irq |
149 | * @irq: first irq to be managed by the controller | 147 | * @irq: first irq to be managed by the controller |
150 | * | 148 | * |
@@ -153,13 +151,13 @@ void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, | |||
153 | * be changed as well, but the controller probably should use m68k_irq_startup/ | 151 | * be changed as well, but the controller probably should use m68k_irq_startup/ |
154 | * m68k_irq_shutdown. | 152 | * m68k_irq_shutdown. |
155 | */ | 153 | */ |
156 | void m68k_setup_irq_controller(struct irq_controller *contr, unsigned int irq, | 154 | void m68k_setup_irq_chip(struct irq_chip *contr, unsigned int irq, |
157 | unsigned int cnt) | 155 | unsigned int cnt) |
158 | { | 156 | { |
159 | int i; | 157 | int i; |
160 | 158 | ||
161 | for (i = 0; i < cnt; i++) | 159 | for (i = 0; i < cnt; i++) |
162 | irq_controller[irq + i] = contr; | 160 | irq_chip[irq + i] = contr; |
163 | } | 161 | } |
164 | 162 | ||
165 | irq_node_t *new_irq_node(void) | 163 | irq_node_t *new_irq_node(void) |
@@ -180,23 +178,23 @@ irq_node_t *new_irq_node(void) | |||
180 | 178 | ||
181 | int setup_irq(unsigned int irq, struct irq_node *node) | 179 | int setup_irq(unsigned int irq, struct irq_node *node) |
182 | { | 180 | { |
183 | struct irq_controller *contr; | 181 | struct irq_chip *contr; |
184 | struct irq_node **prev; | 182 | struct irq_node **prev; |
185 | unsigned long flags; | 183 | unsigned long flags; |
186 | 184 | ||
187 | if (irq >= NR_IRQS || !(contr = irq_controller[irq])) { | 185 | if (irq >= NR_IRQS || !(contr = irq_chip[irq])) { |
188 | printk("%s: Incorrect IRQ %d from %s\n", | 186 | printk("%s: Incorrect IRQ %d from %s\n", |
189 | __func__, irq, node->devname); | 187 | __func__, irq, node->devname); |
190 | return -ENXIO; | 188 | return -ENXIO; |
191 | } | 189 | } |
192 | 190 | ||
193 | spin_lock_irqsave(&contr->lock, flags); | 191 | local_irq_save(flags); |
194 | 192 | ||
195 | prev = irq_list + irq; | 193 | prev = irq_list + irq; |
196 | if (*prev) { | 194 | if (*prev) { |
197 | /* Can't share interrupts unless both agree to */ | 195 | /* Can't share interrupts unless both agree to */ |
198 | if (!((*prev)->flags & node->flags & IRQF_SHARED)) { | 196 | if (!((*prev)->flags & node->flags & IRQF_SHARED)) { |
199 | spin_unlock_irqrestore(&contr->lock, flags); | 197 | local_irq_restore(flags); |
200 | return -EBUSY; | 198 | return -EBUSY; |
201 | } | 199 | } |
202 | while (*prev) | 200 | while (*prev) |
@@ -204,15 +202,15 @@ int setup_irq(unsigned int irq, struct irq_node *node) | |||
204 | } | 202 | } |
205 | 203 | ||
206 | if (!irq_list[irq]) { | 204 | if (!irq_list[irq]) { |
207 | if (contr->startup) | 205 | if (contr->irq_startup) |
208 | contr->startup(irq); | 206 | contr->irq_startup(irq); |
209 | else | 207 | else |
210 | contr->enable(irq); | 208 | contr->irq_enable(irq); |
211 | } | 209 | } |
212 | node->next = NULL; | 210 | node->next = NULL; |
213 | *prev = node; | 211 | *prev = node; |
214 | 212 | ||
215 | spin_unlock_irqrestore(&contr->lock, flags); | 213 | local_irq_restore(flags); |
216 | 214 | ||
217 | return 0; | 215 | return 0; |
218 | } | 216 | } |
@@ -244,16 +242,16 @@ EXPORT_SYMBOL(request_irq); | |||
244 | 242 | ||
245 | void free_irq(unsigned int irq, void *dev_id) | 243 | void free_irq(unsigned int irq, void *dev_id) |
246 | { | 244 | { |
247 | struct irq_controller *contr; | 245 | struct irq_chip *contr; |
248 | struct irq_node **p, *node; | 246 | struct irq_node **p, *node; |
249 | unsigned long flags; | 247 | unsigned long flags; |
250 | 248 | ||
251 | if (irq >= NR_IRQS || !(contr = irq_controller[irq])) { | 249 | if (irq >= NR_IRQS || !(contr = irq_chip[irq])) { |
252 | printk("%s: Incorrect IRQ %d\n", __func__, irq); | 250 | printk("%s: Incorrect IRQ %d\n", __func__, irq); |
253 | return; | 251 | return; |
254 | } | 252 | } |
255 | 253 | ||
256 | spin_lock_irqsave(&contr->lock, flags); | 254 | local_irq_save(flags); |
257 | 255 | ||
258 | p = irq_list + irq; | 256 | p = irq_list + irq; |
259 | while ((node = *p)) { | 257 | while ((node = *p)) { |
@@ -270,58 +268,58 @@ void free_irq(unsigned int irq, void *dev_id) | |||
270 | __func__, irq); | 268 | __func__, irq); |
271 | 269 | ||
272 | if (!irq_list[irq]) { | 270 | if (!irq_list[irq]) { |
273 | if (contr->shutdown) | 271 | if (contr->irq_shutdown) |
274 | contr->shutdown(irq); | 272 | contr->irq_shutdown(irq); |
275 | else | 273 | else |
276 | contr->disable(irq); | 274 | contr->irq_disable(irq); |
277 | } | 275 | } |
278 | 276 | ||
279 | spin_unlock_irqrestore(&contr->lock, flags); | 277 | local_irq_restore(flags); |
280 | } | 278 | } |
281 | 279 | ||
282 | EXPORT_SYMBOL(free_irq); | 280 | EXPORT_SYMBOL(free_irq); |
283 | 281 | ||
284 | void enable_irq(unsigned int irq) | 282 | void enable_irq(unsigned int irq) |
285 | { | 283 | { |
286 | struct irq_controller *contr; | 284 | struct irq_chip *contr; |
287 | unsigned long flags; | 285 | unsigned long flags; |
288 | 286 | ||
289 | if (irq >= NR_IRQS || !(contr = irq_controller[irq])) { | 287 | if (irq >= NR_IRQS || !(contr = irq_chip[irq])) { |
290 | printk("%s: Incorrect IRQ %d\n", | 288 | printk("%s: Incorrect IRQ %d\n", |
291 | __func__, irq); | 289 | __func__, irq); |
292 | return; | 290 | return; |
293 | } | 291 | } |
294 | 292 | ||
295 | spin_lock_irqsave(&contr->lock, flags); | 293 | local_irq_save(flags); |
296 | if (irq_depth[irq]) { | 294 | if (irq_depth[irq]) { |
297 | if (!--irq_depth[irq]) { | 295 | if (!--irq_depth[irq]) { |
298 | if (contr->enable) | 296 | if (contr->irq_enable) |
299 | contr->enable(irq); | 297 | contr->irq_enable(irq); |
300 | } | 298 | } |
301 | } else | 299 | } else |
302 | WARN_ON(1); | 300 | WARN_ON(1); |
303 | spin_unlock_irqrestore(&contr->lock, flags); | 301 | local_irq_restore(flags); |
304 | } | 302 | } |
305 | 303 | ||
306 | EXPORT_SYMBOL(enable_irq); | 304 | EXPORT_SYMBOL(enable_irq); |
307 | 305 | ||
308 | void disable_irq(unsigned int irq) | 306 | void disable_irq(unsigned int irq) |
309 | { | 307 | { |
310 | struct irq_controller *contr; | 308 | struct irq_chip *contr; |
311 | unsigned long flags; | 309 | unsigned long flags; |
312 | 310 | ||
313 | if (irq >= NR_IRQS || !(contr = irq_controller[irq])) { | 311 | if (irq >= NR_IRQS || !(contr = irq_chip[irq])) { |
314 | printk("%s: Incorrect IRQ %d\n", | 312 | printk("%s: Incorrect IRQ %d\n", |
315 | __func__, irq); | 313 | __func__, irq); |
316 | return; | 314 | return; |
317 | } | 315 | } |
318 | 316 | ||
319 | spin_lock_irqsave(&contr->lock, flags); | 317 | local_irq_save(flags); |
320 | if (!irq_depth[irq]++) { | 318 | if (!irq_depth[irq]++) { |
321 | if (contr->disable) | 319 | if (contr->irq_disable) |
322 | contr->disable(irq); | 320 | contr->irq_disable(irq); |
323 | } | 321 | } |
324 | spin_unlock_irqrestore(&contr->lock, flags); | 322 | local_irq_restore(flags); |
325 | } | 323 | } |
326 | 324 | ||
327 | EXPORT_SYMBOL(disable_irq); | 325 | EXPORT_SYMBOL(disable_irq); |
@@ -330,7 +328,7 @@ void disable_irq_nosync(unsigned int irq) __attribute__((alias("disable_irq"))); | |||
330 | 328 | ||
331 | EXPORT_SYMBOL(disable_irq_nosync); | 329 | EXPORT_SYMBOL(disable_irq_nosync); |
332 | 330 | ||
333 | int m68k_irq_startup(unsigned int irq) | 331 | unsigned int m68k_irq_startup(unsigned int irq) |
334 | { | 332 | { |
335 | if (irq <= IRQ_AUTO_7) | 333 | if (irq <= IRQ_AUTO_7) |
336 | vectors[VEC_SPUR + irq] = auto_inthandler; | 334 | vectors[VEC_SPUR + irq] = auto_inthandler; |
@@ -413,13 +411,13 @@ asmlinkage void handle_badint(struct pt_regs *regs) | |||
413 | 411 | ||
414 | int show_interrupts(struct seq_file *p, void *v) | 412 | int show_interrupts(struct seq_file *p, void *v) |
415 | { | 413 | { |
416 | struct irq_controller *contr; | 414 | struct irq_chip *contr; |
417 | struct irq_node *node; | 415 | struct irq_node *node; |
418 | int i = *(loff_t *) v; | 416 | int i = *(loff_t *) v; |
419 | 417 | ||
420 | /* autovector interrupts */ | 418 | /* autovector interrupts */ |
421 | if (irq_list[i]) { | 419 | if (irq_list[i]) { |
422 | contr = irq_controller[i]; | 420 | contr = irq_chip[i]; |
423 | node = irq_list[i]; | 421 | node = irq_list[i]; |
424 | seq_printf(p, "%-8s %3u: %10u %s", contr->name, i, kstat_cpu(0).irqs[i], node->devname); | 422 | seq_printf(p, "%-8s %3u: %10u %s", contr->name, i, kstat_cpu(0).irqs[i], node->devname); |
425 | while ((node = node->next)) | 423 | while ((node = node->next)) |
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index f92190c159b4..ffa1b3f7e2b7 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c | |||
@@ -193,11 +193,10 @@ irqreturn_t mac_debug_handler(int, void *); | |||
193 | void mac_enable_irq(unsigned int irq); | 193 | void mac_enable_irq(unsigned int irq); |
194 | void mac_disable_irq(unsigned int irq); | 194 | void mac_disable_irq(unsigned int irq); |
195 | 195 | ||
196 | static struct irq_controller mac_irq_controller = { | 196 | static struct irq_chip mac_irq_chip = { |
197 | .name = "mac", | 197 | .name = "mac", |
198 | .lock = __SPIN_LOCK_UNLOCKED(mac_irq_controller.lock), | 198 | .irq_enable = mac_enable_irq, |
199 | .enable = mac_enable_irq, | 199 | .irq_disable = mac_disable_irq, |
200 | .disable = mac_disable_irq, | ||
201 | }; | 200 | }; |
202 | 201 | ||
203 | void __init mac_init_IRQ(void) | 202 | void __init mac_init_IRQ(void) |
@@ -205,7 +204,7 @@ void __init mac_init_IRQ(void) | |||
205 | #ifdef DEBUG_MACINTS | 204 | #ifdef DEBUG_MACINTS |
206 | printk("mac_init_IRQ(): Setting things up...\n"); | 205 | printk("mac_init_IRQ(): Setting things up...\n"); |
207 | #endif | 206 | #endif |
208 | m68k_setup_irq_controller(&mac_irq_controller, IRQ_USER, | 207 | m68k_setup_irq_chip(&mac_irq_chip, IRQ_USER, |
209 | NUM_MAC_SOURCES - IRQ_USER); | 208 | NUM_MAC_SOURCES - IRQ_USER); |
210 | /* Make sure the SONIC interrupt is cleared or things get ugly */ | 209 | /* Make sure the SONIC interrupt is cleared or things get ugly */ |
211 | #ifdef SHUTUP_SONIC | 210 | #ifdef SHUTUP_SONIC |
diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c index 9f0e3d59bf92..fa05a03f8dfe 100644 --- a/arch/m68k/q40/q40ints.c +++ b/arch/m68k/q40/q40ints.c | |||
@@ -41,14 +41,14 @@ static void q40_disable_irq(unsigned int); | |||
41 | unsigned short q40_ablecount[35]; | 41 | unsigned short q40_ablecount[35]; |
42 | unsigned short q40_state[35]; | 42 | unsigned short q40_state[35]; |
43 | 43 | ||
44 | static int q40_irq_startup(unsigned int irq) | 44 | static unsigned int q40_irq_startup(unsigned int irq) |
45 | { | 45 | { |
46 | /* test for ISA ints not implemented by HW */ | 46 | /* test for ISA ints not implemented by HW */ |
47 | switch (irq) { | 47 | switch (irq) { |
48 | case 1: case 2: case 8: case 9: | 48 | case 1: case 2: case 8: case 9: |
49 | case 11: case 12: case 13: | 49 | case 11: case 12: case 13: |
50 | printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq); | 50 | printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq); |
51 | return -ENXIO; | 51 | /* FIXME return -ENXIO; */ |
52 | } | 52 | } |
53 | return 0; | 53 | return 0; |
54 | } | 54 | } |
@@ -57,13 +57,12 @@ static void q40_irq_shutdown(unsigned int irq) | |||
57 | { | 57 | { |
58 | } | 58 | } |
59 | 59 | ||
60 | static struct irq_controller q40_irq_controller = { | 60 | static struct irq_chip q40_irq_chip = { |
61 | .name = "q40", | 61 | .name = "q40", |
62 | .lock = __SPIN_LOCK_UNLOCKED(q40_irq_controller.lock), | 62 | .irq_startup = q40_irq_startup, |
63 | .startup = q40_irq_startup, | 63 | .irq_shutdown = q40_irq_shutdown, |
64 | .shutdown = q40_irq_shutdown, | 64 | .irq_enable = q40_enable_irq, |
65 | .enable = q40_enable_irq, | 65 | .irq_disable = q40_disable_irq, |
66 | .disable = q40_disable_irq, | ||
67 | }; | 66 | }; |
68 | 67 | ||
69 | /* | 68 | /* |
@@ -81,7 +80,7 @@ static int disabled; | |||
81 | 80 | ||
82 | void __init q40_init_IRQ(void) | 81 | void __init q40_init_IRQ(void) |
83 | { | 82 | { |
84 | m68k_setup_irq_controller(&q40_irq_controller, 1, Q40_IRQ_MAX); | 83 | m68k_setup_irq_chip(&q40_irq_chip, 1, Q40_IRQ_MAX); |
85 | 84 | ||
86 | /* setup handler for ISA ints */ | 85 | /* setup handler for ISA ints */ |
87 | m68k_setup_auto_interrupt(q40_irq_handler); | 86 | m68k_setup_auto_interrupt(q40_irq_handler); |
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index 6464ad3ae3e6..97fa9edc5a9d 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c | |||
@@ -86,13 +86,12 @@ static void sun3_inthandle(unsigned int irq, struct pt_regs *fp) | |||
86 | __m68k_handle_int(irq, fp); | 86 | __m68k_handle_int(irq, fp); |
87 | } | 87 | } |
88 | 88 | ||
89 | static struct irq_controller sun3_irq_controller = { | 89 | static struct irq_chip sun3_irq_chip = { |
90 | .name = "sun3", | 90 | .name = "sun3", |
91 | .lock = __SPIN_LOCK_UNLOCKED(sun3_irq_controller.lock), | 91 | .irq_startup = m68k_irq_startup, |
92 | .startup = m68k_irq_startup, | 92 | .irq_shutdown = m68k_irq_shutdown, |
93 | .shutdown = m68k_irq_shutdown, | 93 | .irq_enable = sun3_enable_irq, |
94 | .enable = sun3_enable_irq, | 94 | .irq_disable = sun3_disable_irq, |
95 | .disable = sun3_disable_irq, | ||
96 | }; | 95 | }; |
97 | 96 | ||
98 | void __init sun3_init_IRQ(void) | 97 | void __init sun3_init_IRQ(void) |
@@ -100,7 +99,7 @@ void __init sun3_init_IRQ(void) | |||
100 | *sun3_intreg = 1; | 99 | *sun3_intreg = 1; |
101 | 100 | ||
102 | m68k_setup_auto_interrupt(sun3_inthandle); | 101 | m68k_setup_auto_interrupt(sun3_inthandle); |
103 | m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7); | 102 | m68k_setup_irq_chip(&sun3_irq_chip, IRQ_AUTO_1, 7); |
104 | m68k_setup_user_interrupt(VEC_USER, 128, NULL); | 103 | m68k_setup_user_interrupt(VEC_USER, 128, NULL); |
105 | 104 | ||
106 | if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL)) | 105 | if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL)) |