diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-03 07:23:54 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-19 06:58:10 -0500 |
commit | 50f7c0327513d5acefbe26fd33498af18d1ffac5 (patch) | |
tree | cab9352b720cccbe0b230b97b26b2bc40ca0405b /kernel/irq/chip.c | |
parent | 87923470c712dff00b101ffb6b6fbc27bd7a6df5 (diff) |
genirq: Remove default magic
Now that everything uses the wrappers, we can remove the default
functions. None of those functions is performance critical.
That makes the IRQ_MASKED flag tracking fully consistent.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/chip.c')
-rw-r--r-- | kernel/irq/chip.c | 73 |
1 files changed, 15 insertions, 58 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 86c8e42f7fe4..1a239a83f925 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -208,45 +208,29 @@ void irq_shutdown(struct irq_desc *desc) | |||
208 | { | 208 | { |
209 | desc->status |= IRQ_MASKED | IRQ_DISABLED; | 209 | desc->status |= IRQ_MASKED | IRQ_DISABLED; |
210 | desc->depth = 1; | 210 | desc->depth = 1; |
211 | desc->irq_data.chip->irq_shutdown(&desc->irq_data); | 211 | if (desc->irq_data.chip->irq_shutdown) |
212 | desc->irq_data.chip->irq_shutdown(&desc->irq_data); | ||
213 | if (desc->irq_data.chip->irq_disable) | ||
214 | desc->irq_data.chip->irq_disable(&desc->irq_data); | ||
215 | else | ||
216 | desc->irq_data.chip->irq_mask(&desc->irq_data); | ||
212 | } | 217 | } |
213 | 218 | ||
214 | void irq_enable(struct irq_desc *desc) | 219 | void irq_enable(struct irq_desc *desc) |
215 | { | 220 | { |
216 | desc->irq_data.chip->irq_enable(&desc->irq_data); | 221 | if (desc->irq_data.chip->irq_enable) |
217 | } | 222 | desc->irq_data.chip->irq_enable(&desc->irq_data); |
218 | 223 | else | |
219 | void irq_disable(struct irq_desc *desc) | 224 | desc->irq_data.chip->irq_unmask(&desc->irq_data); |
220 | { | ||
221 | desc->irq_data.chip->irq_disable(&desc->irq_data); | ||
222 | } | ||
223 | |||
224 | /* | ||
225 | * default enable function | ||
226 | */ | ||
227 | static void default_enable(struct irq_data *data) | ||
228 | { | ||
229 | struct irq_desc *desc = irq_data_to_desc(data); | ||
230 | |||
231 | desc->irq_data.chip->irq_unmask(&desc->irq_data); | ||
232 | desc->status &= ~IRQ_MASKED; | 225 | desc->status &= ~IRQ_MASKED; |
233 | } | 226 | } |
234 | 227 | ||
235 | /* | 228 | void irq_disable(struct irq_desc *desc) |
236 | * default disable function | ||
237 | */ | ||
238 | static void default_disable(struct irq_data *data) | ||
239 | { | ||
240 | } | ||
241 | |||
242 | /* | ||
243 | * default shutdown function | ||
244 | */ | ||
245 | static void default_shutdown(struct irq_data *data) | ||
246 | { | 229 | { |
247 | struct irq_desc *desc = irq_data_to_desc(data); | 230 | if (desc->irq_data.chip->irq_disable) { |
248 | 231 | desc->irq_data.chip->irq_disable(&desc->irq_data); | |
249 | desc->irq_data.chip->irq_mask(&desc->irq_data); | 232 | desc->status |= IRQ_MASKED; |
233 | } | ||
250 | } | 234 | } |
251 | 235 | ||
252 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED | 236 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED |
@@ -334,10 +318,6 @@ static void compat_bus_sync_unlock(struct irq_data *data) | |||
334 | void irq_chip_set_defaults(struct irq_chip *chip) | 318 | void irq_chip_set_defaults(struct irq_chip *chip) |
335 | { | 319 | { |
336 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED | 320 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED |
337 | /* | ||
338 | * Compat fixup functions need to be before we set the | ||
339 | * defaults for enable/disable/startup/shutdown | ||
340 | */ | ||
341 | if (chip->enable) | 321 | if (chip->enable) |
342 | chip->irq_enable = compat_irq_enable; | 322 | chip->irq_enable = compat_irq_enable; |
343 | if (chip->disable) | 323 | if (chip->disable) |
@@ -346,31 +326,8 @@ void irq_chip_set_defaults(struct irq_chip *chip) | |||
346 | chip->irq_shutdown = compat_irq_shutdown; | 326 | chip->irq_shutdown = compat_irq_shutdown; |
347 | if (chip->startup) | 327 | if (chip->startup) |
348 | chip->irq_startup = compat_irq_startup; | 328 | chip->irq_startup = compat_irq_startup; |
349 | #endif | ||
350 | /* | ||
351 | * The real defaults | ||
352 | */ | ||
353 | if (!chip->irq_enable) | ||
354 | chip->irq_enable = default_enable; | ||
355 | if (!chip->irq_disable) | ||
356 | chip->irq_disable = default_disable; | ||
357 | /* | ||
358 | * We use chip->irq_disable, when the user provided its own. When | ||
359 | * we have default_disable set for chip->irq_disable, then we need | ||
360 | * to use default_shutdown, otherwise the irq line is not | ||
361 | * disabled on free_irq(): | ||
362 | */ | ||
363 | if (!chip->irq_shutdown) | ||
364 | chip->irq_shutdown = chip->irq_disable != default_disable ? | ||
365 | chip->irq_disable : default_shutdown; | ||
366 | |||
367 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED | ||
368 | if (!chip->end) | 329 | if (!chip->end) |
369 | chip->end = dummy_irq_chip.end; | 330 | chip->end = dummy_irq_chip.end; |
370 | |||
371 | /* | ||
372 | * Now fix up the remaining compat handlers | ||
373 | */ | ||
374 | if (chip->bus_lock) | 331 | if (chip->bus_lock) |
375 | chip->irq_bus_lock = compat_bus_lock; | 332 | chip->irq_bus_lock = compat_bus_lock; |
376 | if (chip->bus_sync_unlock) | 333 | if (chip->bus_sync_unlock) |