diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-10-01 09:17:14 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-10-04 07:40:24 -0400 |
commit | bd151412263a67b5321e9dd1d5b4bf6d96fdebf3 (patch) | |
tree | 7571b3eaf7ebc2ef200fb00688543f00a451c5f9 /kernel/irq | |
parent | 21e2b8c62cca8f7dbec0c8c131ca1637e4a5670f (diff) |
genirq: Provide config option to disable deprecated code
This option covers now the old chip functions and the irq_desc data
fields which are moving to struct irq_data. More stuff will follow.
Pretty handy for testing a conversion, whether something broke or not.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/Kconfig | 4 | ||||
-rw-r--r-- | kernel/irq/chip.c | 8 | ||||
-rw-r--r-- | kernel/irq/handle.c | 9 | ||||
-rw-r--r-- | kernel/irq/internals.h | 10 | ||||
-rw-r--r-- | kernel/irq/spurious.c | 6 |
5 files changed, 32 insertions, 5 deletions
diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig index e0fc6cd78aa0..a42c0191d71a 100644 --- a/kernel/irq/Kconfig +++ b/kernel/irq/Kconfig | |||
@@ -12,6 +12,10 @@ config GENERIC_HARDIRQS | |||
12 | config GENERIC_HARDIRQS_NO__DO_IRQ | 12 | config GENERIC_HARDIRQS_NO__DO_IRQ |
13 | def_bool y | 13 | def_bool y |
14 | 14 | ||
15 | # Select this to disable the deprecated stuff | ||
16 | config GENERIC_HARDIRQS_NO_DEPRECATED | ||
17 | def_bool n | ||
18 | |||
15 | # Options selectable by the architecture code | 19 | # Options selectable by the architecture code |
16 | config HAVE_SPARSE_IRQ | 20 | config HAVE_SPARSE_IRQ |
17 | def_bool n | 21 | def_bool n |
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index f2c4d28c508a..323547983f15 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -324,6 +324,7 @@ static void default_shutdown(struct irq_data *data) | |||
324 | desc->status |= IRQ_MASKED; | 324 | desc->status |= IRQ_MASKED; |
325 | } | 325 | } |
326 | 326 | ||
327 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED | ||
327 | /* Temporary migration helpers */ | 328 | /* Temporary migration helpers */ |
328 | static void compat_irq_mask(struct irq_data *data) | 329 | static void compat_irq_mask(struct irq_data *data) |
329 | { | 330 | { |
@@ -400,12 +401,14 @@ static void compat_bus_sync_unlock(struct irq_data *data) | |||
400 | { | 401 | { |
401 | data->chip->bus_sync_unlock(data->irq); | 402 | data->chip->bus_sync_unlock(data->irq); |
402 | } | 403 | } |
404 | #endif | ||
403 | 405 | ||
404 | /* | 406 | /* |
405 | * Fixup enable/disable function pointers | 407 | * Fixup enable/disable function pointers |
406 | */ | 408 | */ |
407 | void irq_chip_set_defaults(struct irq_chip *chip) | 409 | void irq_chip_set_defaults(struct irq_chip *chip) |
408 | { | 410 | { |
411 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED | ||
409 | /* | 412 | /* |
410 | * Compat fixup functions need to be before we set the | 413 | * Compat fixup functions need to be before we set the |
411 | * defaults for enable/disable/startup/shutdown | 414 | * defaults for enable/disable/startup/shutdown |
@@ -418,7 +421,7 @@ void irq_chip_set_defaults(struct irq_chip *chip) | |||
418 | chip->irq_shutdown = compat_irq_shutdown; | 421 | chip->irq_shutdown = compat_irq_shutdown; |
419 | if (chip->startup) | 422 | if (chip->startup) |
420 | chip->irq_startup = compat_irq_startup; | 423 | chip->irq_startup = compat_irq_startup; |
421 | 424 | #endif | |
422 | /* | 425 | /* |
423 | * The real defaults | 426 | * The real defaults |
424 | */ | 427 | */ |
@@ -437,6 +440,8 @@ void irq_chip_set_defaults(struct irq_chip *chip) | |||
437 | if (!chip->irq_shutdown) | 440 | if (!chip->irq_shutdown) |
438 | chip->irq_shutdown = chip->irq_disable != default_disable ? | 441 | chip->irq_shutdown = chip->irq_disable != default_disable ? |
439 | chip->irq_disable : default_shutdown; | 442 | chip->irq_disable : default_shutdown; |
443 | |||
444 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED | ||
440 | if (!chip->end) | 445 | if (!chip->end) |
441 | chip->end = dummy_irq_chip.end; | 446 | chip->end = dummy_irq_chip.end; |
442 | 447 | ||
@@ -465,6 +470,7 @@ void irq_chip_set_defaults(struct irq_chip *chip) | |||
465 | chip->irq_set_wake = compat_irq_set_wake; | 470 | chip->irq_set_wake = compat_irq_set_wake; |
466 | if (chip->retrigger) | 471 | if (chip->retrigger) |
467 | chip->irq_retrigger = compat_irq_retrigger; | 472 | chip->irq_retrigger = compat_irq_retrigger; |
473 | #endif | ||
468 | } | 474 | } |
469 | 475 | ||
470 | static inline void mask_ack_irq(struct irq_desc *desc) | 476 | static inline void mask_ack_irq(struct irq_desc *desc) |
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index 8d0697f892a2..3fcef37154a1 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
@@ -309,7 +309,12 @@ static unsigned int noop_ret(struct irq_data *data) | |||
309 | return 0; | 309 | return 0; |
310 | } | 310 | } |
311 | 311 | ||
312 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED | ||
312 | static void compat_noop(unsigned int irq) { } | 313 | static void compat_noop(unsigned int irq) { } |
314 | #define END_INIT .end = compat_noop | ||
315 | #else | ||
316 | #define END_INIT | ||
317 | #endif | ||
313 | 318 | ||
314 | /* | 319 | /* |
315 | * Generic no controller implementation | 320 | * Generic no controller implementation |
@@ -321,7 +326,7 @@ struct irq_chip no_irq_chip = { | |||
321 | .irq_enable = noop, | 326 | .irq_enable = noop, |
322 | .irq_disable = noop, | 327 | .irq_disable = noop, |
323 | .irq_ack = ack_bad, | 328 | .irq_ack = ack_bad, |
324 | .end = compat_noop, | 329 | END_INIT |
325 | }; | 330 | }; |
326 | 331 | ||
327 | /* | 332 | /* |
@@ -337,7 +342,7 @@ struct irq_chip dummy_irq_chip = { | |||
337 | .irq_ack = noop, | 342 | .irq_ack = noop, |
338 | .irq_mask = noop, | 343 | .irq_mask = noop, |
339 | .irq_unmask = noop, | 344 | .irq_unmask = noop, |
340 | .end = compat_noop, | 345 | END_INIT |
341 | }; | 346 | }; |
342 | 347 | ||
343 | /* | 348 | /* |
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index ecafbfee5b12..b905f0ab1bb2 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h | |||
@@ -42,6 +42,16 @@ extern int irq_select_affinity_usr(unsigned int irq); | |||
42 | 42 | ||
43 | extern void irq_set_thread_affinity(struct irq_desc *desc); | 43 | extern void irq_set_thread_affinity(struct irq_desc *desc); |
44 | 44 | ||
45 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED | ||
46 | static inline void irq_end(unsigned int irq, struct irq_desc *desc) | ||
47 | { | ||
48 | if (desc->irq_data.chip && desc->irq_data.chip->end) | ||
49 | desc->irq_data.chip->end(irq); | ||
50 | } | ||
51 | #else | ||
52 | static inline void irq_end(unsigned int irq, struct irq_desc *desc) { } | ||
53 | #endif | ||
54 | |||
45 | /* Inline functions for support of irq chips on slow busses */ | 55 | /* Inline functions for support of irq chips on slow busses */ |
46 | static inline void chip_bus_lock(struct irq_desc *desc) | 56 | static inline void chip_bus_lock(struct irq_desc *desc) |
47 | { | 57 | { |
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c index 9ee704d3a23c..3089d3b9d5f3 100644 --- a/kernel/irq/spurious.c +++ b/kernel/irq/spurious.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/moduleparam.h> | 14 | #include <linux/moduleparam.h> |
15 | #include <linux/timer.h> | 15 | #include <linux/timer.h> |
16 | 16 | ||
17 | #include "internals.h" | ||
18 | |||
17 | static int irqfixup __read_mostly; | 19 | static int irqfixup __read_mostly; |
18 | 20 | ||
19 | #define POLL_SPURIOUS_IRQ_INTERVAL (HZ/10) | 21 | #define POLL_SPURIOUS_IRQ_INTERVAL (HZ/10) |
@@ -78,8 +80,8 @@ static int try_one_irq(int irq, struct irq_desc *desc) | |||
78 | * If we did actual work for the real IRQ line we must let the | 80 | * If we did actual work for the real IRQ line we must let the |
79 | * IRQ controller clean up too | 81 | * IRQ controller clean up too |
80 | */ | 82 | */ |
81 | if (work && desc->irq_data.chip && desc->irq_data.chip->end) | 83 | if (work) |
82 | desc->irq_data.chip->end(irq); | 84 | irq_end(irq, desc); |
83 | raw_spin_unlock(&desc->lock); | 85 | raw_spin_unlock(&desc->lock); |
84 | 86 | ||
85 | return ok; | 87 | return ok; |