Skip to content

Commit 1b7a2d9

Browse files
committed
arm: Use irq flag setter function
Use the proper accessor function instead of fiddling in the status bits directly. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arm-kernel@lists.infradead.org
1 parent 1475b85 commit 1b7a2d9

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

‎arch/arm/kernel/irq.c‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,24 +144,21 @@ asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
144144

145145
void set_irq_flags(unsigned int irq, unsigned int iflags)
146146
{
147-
struct irq_desc *desc;
148-
unsigned long flags;
147+
unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
149148

150149
if (irq >= nr_irqs) {
151150
printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq);
152151
return;
153152
}
154153

155-
desc = irq_to_desc(irq);
156-
raw_spin_lock_irqsave(&desc->lock, flags);
157-
desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
158154
if (iflags & IRQF_VALID)
159-
desc->status &= ~IRQ_NOREQUEST;
155+
clr |= IRQ_NOREQUEST;
160156
if (iflags & IRQF_PROBE)
161-
desc->status &= ~IRQ_NOPROBE;
157+
clr |= IRQ_NOPROBE;
162158
if (!(iflags & IRQF_NOAUTOEN))
163-
desc->status &= ~IRQ_NOAUTOEN;
164-
raw_spin_unlock_irqrestore(&desc->lock, flags);
159+
clr |= IRQ_NOAUTOEN;
160+
/* Order is clear bits in "clr" then set bits in "set" */
161+
irq_modify_status(irq, clr, set & ~clr);
165162
}
166163

167164
void __init init_IRQ(void)

0 commit comments

Comments
 (0)