Commit 3cca53b0 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds

[PATCH] irq-flags: generic irq: Use the new IRQF_ constants

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 85ac3ab2
...@@ -113,7 +113,7 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs, ...@@ -113,7 +113,7 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
irqreturn_t ret, retval = IRQ_NONE; irqreturn_t ret, retval = IRQ_NONE;
unsigned int status = 0; unsigned int status = 0;
if (!(action->flags & SA_INTERRUPT)) if (!(action->flags & IRQF_DISABLED))
local_irq_enable(); local_irq_enable();
do { do {
...@@ -124,7 +124,7 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs, ...@@ -124,7 +124,7 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
action = action->next; action = action->next;
} while (action); } while (action);
if (status & SA_SAMPLE_RANDOM) if (status & IRQF_SAMPLE_RANDOM)
add_interrupt_randomness(irq); add_interrupt_randomness(irq);
local_irq_disable(); local_irq_disable();
......
...@@ -167,7 +167,7 @@ int can_request_irq(unsigned int irq, unsigned long irqflags) ...@@ -167,7 +167,7 @@ int can_request_irq(unsigned int irq, unsigned long irqflags)
action = irq_desc[irq].action; action = irq_desc[irq].action;
if (action) if (action)
if (irqflags & action->flags & SA_SHIRQ) if (irqflags & action->flags & IRQF_SHARED)
action = NULL; action = NULL;
return !action; return !action;
...@@ -205,7 +205,7 @@ int setup_irq(unsigned int irq, struct irqaction *new) ...@@ -205,7 +205,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
* so we have to be careful not to interfere with a * so we have to be careful not to interfere with a
* running system. * running system.
*/ */
if (new->flags & SA_SAMPLE_RANDOM) { if (new->flags & IRQF_SAMPLE_RANDOM) {
/* /*
* This function might sleep, we want to call it first, * This function might sleep, we want to call it first,
* outside of the atomic block. * outside of the atomic block.
...@@ -227,17 +227,17 @@ int setup_irq(unsigned int irq, struct irqaction *new) ...@@ -227,17 +227,17 @@ int setup_irq(unsigned int irq, struct irqaction *new)
/* /*
* Can't share interrupts unless both agree to and are * Can't share interrupts unless both agree to and are
* the same type (level, edge, polarity). So both flag * the same type (level, edge, polarity). So both flag
* fields must have SA_SHIRQ set and the bits which * fields must have IRQF_SHARED set and the bits which
* set the trigger type must match. * set the trigger type must match.
*/ */
if (!((old->flags & new->flags) & SA_SHIRQ) || if (!((old->flags & new->flags) & IRQF_SHARED) ||
((old->flags ^ new->flags) & SA_TRIGGER_MASK)) ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK))
goto mismatch; goto mismatch;
#if defined(CONFIG_IRQ_PER_CPU) && defined(SA_PERCPU_IRQ) #if defined(CONFIG_IRQ_PER_CPU) && defined(IRQF_PERCPU)
/* All handlers must agree on per-cpuness */ /* All handlers must agree on per-cpuness */
if ((old->flags & SA_PERCPU_IRQ) != if ((old->flags & IRQF_PERCPU) !=
(new->flags & SA_PERCPU_IRQ)) (new->flags & IRQF_PERCPU))
goto mismatch; goto mismatch;
#endif #endif
...@@ -250,24 +250,24 @@ int setup_irq(unsigned int irq, struct irqaction *new) ...@@ -250,24 +250,24 @@ int setup_irq(unsigned int irq, struct irqaction *new)
} }
*p = new; *p = new;
#if defined(CONFIG_IRQ_PER_CPU) && defined(SA_PERCPU_IRQ) #if defined(CONFIG_IRQ_PER_CPU) && defined(IRQF_PERCPU)
if (new->flags & SA_PERCPU_IRQ) if (new->flags & IRQF_PERCPU)
desc->status |= IRQ_PER_CPU; desc->status |= IRQ_PER_CPU;
#endif #endif
if (!shared) { if (!shared) {
irq_chip_set_defaults(desc->chip); irq_chip_set_defaults(desc->chip);
/* Setup the type (level, edge polarity) if configured: */ /* Setup the type (level, edge polarity) if configured: */
if (new->flags & SA_TRIGGER_MASK) { if (new->flags & IRQF_TRIGGER_MASK) {
if (desc->chip && desc->chip->set_type) if (desc->chip && desc->chip->set_type)
desc->chip->set_type(irq, desc->chip->set_type(irq,
new->flags & SA_TRIGGER_MASK); new->flags & IRQF_TRIGGER_MASK);
else else
/* /*
* SA_TRIGGER_* but the PIC does not support * IRQF_TRIGGER_* but the PIC does not support
* multiple flow-types? * multiple flow-types?
*/ */
printk(KERN_WARNING "No SA_TRIGGER set_type " printk(KERN_WARNING "No IRQF_TRIGGER set_type "
"function for IRQ %d (%s)\n", irq, "function for IRQ %d (%s)\n", irq,
desc->chip ? desc->chip->name : desc->chip ? desc->chip->name :
"unknown"); "unknown");
...@@ -299,7 +299,7 @@ int setup_irq(unsigned int irq, struct irqaction *new) ...@@ -299,7 +299,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
mismatch: mismatch:
spin_unlock_irqrestore(&desc->lock, flags); spin_unlock_irqrestore(&desc->lock, flags);
if (!(new->flags & SA_PROBEIRQ)) { if (!(new->flags & IRQF_PROBE_SHARED)) {
printk(KERN_ERR "IRQ handler type mismatch for IRQ %d\n", irq); printk(KERN_ERR "IRQ handler type mismatch for IRQ %d\n", irq);
dump_stack(); dump_stack();
} }
...@@ -398,9 +398,9 @@ EXPORT_SYMBOL(free_irq); ...@@ -398,9 +398,9 @@ EXPORT_SYMBOL(free_irq);
* *
* Flags: * Flags:
* *
* SA_SHIRQ Interrupt is shared * IRQF_SHARED Interrupt is shared
* SA_INTERRUPT Disable local interrupts while processing * IRQF_DISABLED Disable local interrupts while processing
* SA_SAMPLE_RANDOM The interrupt can be used for entropy * IRQF_SAMPLE_RANDOM The interrupt can be used for entropy
* *
*/ */
int request_irq(unsigned int irq, int request_irq(unsigned int irq,
...@@ -416,7 +416,7 @@ int request_irq(unsigned int irq, ...@@ -416,7 +416,7 @@ int request_irq(unsigned int irq,
* which interrupt is which (messes up the interrupt freeing * which interrupt is which (messes up the interrupt freeing
* logic etc). * logic etc).
*/ */
if ((irqflags & SA_SHIRQ) && !dev_id) if ((irqflags & IRQF_SHARED) && !dev_id)
return -EINVAL; return -EINVAL;
if (irq >= NR_IRQS) if (irq >= NR_IRQS)
return -EINVAL; return -EINVAL;
......
...@@ -36,7 +36,7 @@ static int misrouted_irq(int irq, struct pt_regs *regs) ...@@ -36,7 +36,7 @@ static int misrouted_irq(int irq, struct pt_regs *regs)
* Already running: If it is shared get the other * Already running: If it is shared get the other
* CPU to go looking for our mystery interrupt too * CPU to go looking for our mystery interrupt too
*/ */
if (desc->action && (desc->action->flags & SA_SHIRQ)) if (desc->action && (desc->action->flags & IRQF_SHARED))
desc->status |= IRQ_PENDING; desc->status |= IRQ_PENDING;
spin_unlock(&desc->lock); spin_unlock(&desc->lock);
continue; continue;
...@@ -48,7 +48,7 @@ static int misrouted_irq(int irq, struct pt_regs *regs) ...@@ -48,7 +48,7 @@ static int misrouted_irq(int irq, struct pt_regs *regs)
while (action) { while (action) {
/* Only shared IRQ handlers are safe to call */ /* Only shared IRQ handlers are safe to call */
if (action->flags & SA_SHIRQ) { if (action->flags & IRQF_SHARED) {
if (action->handler(i, action->dev_id, regs) == if (action->handler(i, action->dev_id, regs) ==
IRQ_HANDLED) IRQ_HANDLED)
ok = 1; ok = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment