summaryrefslogtreecommitdiff
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-03 00:41:14 +0300
committerThomas Gleixner <tglx@linutronix.de>2011-02-19 14:58:10 +0300
commit4699923861513671d3f6ade8efb4e56a9a7ecadf (patch)
tree862cda99b9af6fe96fda955107f24a7b5cc97a18 /kernel/irq/manage.c
parent3b56f0585fd4c02d047dc406668cb40159b2d340 (diff)
downloadlinux-4699923861513671d3f6ade8efb4e56a9a7ecadf.tar.xz
genirq: Consolidate startup/shutdown of interrupts
Aside of duplicated code some of the startup/shutdown sites do not handle the MASKED/DISABLED flags and the depth field at all. Move that to a helper function and take care of it there. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <20110202212551.787481468@linutronix.de>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 30bc8de40905..9c562477e28b 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -906,11 +906,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
if (new->flags & IRQF_ONESHOT)
desc->status |= IRQ_ONESHOT;
- if (!(desc->status & IRQ_NOAUTOEN)) {
- desc->depth = 0;
- desc->status &= ~IRQ_DISABLED;
- desc->irq_data.chip->irq_startup(&desc->irq_data);
- } else
+ if (!(desc->status & IRQ_NOAUTOEN))
+ irq_startup(desc);
+ else
/* Undo nested disables: */
desc->depth = 1;
@@ -1055,10 +1053,8 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id)
#endif
/* If this was the last handler, shut down the IRQ line: */
- if (!desc->action) {
- desc->status |= IRQ_DISABLED;
- desc->irq_data.chip->irq_shutdown(&desc->irq_data);
- }
+ if (!desc->action)
+ irq_shutdown(desc);
#ifdef CONFIG_SMP
/* make sure affinity_hint is cleaned up */