linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: Use generic accessor in irq_set_flags()
@ 2011-02-07 22:56 Thomas Gleixner
  2011-02-08  8:32 ` Uwe Kleine-König
  2011-02-08 23:12 ` Russell King - ARM Linux
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Gleixner @ 2011-02-07 22:56 UTC (permalink / raw)
  To: linux-arm-kernel

The generic irq code provides an accessor function to manipulate
status flags in the irq descriptor. Replace the open coded variant.

Neccecary to let the core code rearrange the internal representation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/arm/kernel/irq.c |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Index: linux-next/arch/arm/kernel/irq.c
===================================================================
--- linux-next.orig/arch/arm/kernel/irq.c
+++ linux-next/arch/arm/kernel/irq.c
@@ -144,24 +144,21 @@ asm_do_IRQ(unsigned int irq, struct pt_r
 
 void set_irq_flags(unsigned int irq, unsigned int iflags)
 {
-	struct irq_desc *desc;
-	unsigned long flags;
+	unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
 
 	if (irq >= nr_irqs) {
 		printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq);
 		return;
 	}
 
-	desc = irq_to_desc(irq);
-	raw_spin_lock_irqsave(&desc->lock, flags);
-	desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
 	if (iflags & IRQF_VALID)
-		desc->status &= ~IRQ_NOREQUEST;
+		clr |= IRQ_NOREQUEST;
 	if (iflags & IRQF_PROBE)
-		desc->status &= ~IRQ_NOPROBE;
+		clr |= IRQ_NOPROBE;
 	if (!(iflags & IRQF_NOAUTOEN))
-		desc->status &= ~IRQ_NOAUTOEN;
-	raw_spin_unlock_irqrestore(&desc->lock, flags);
+		clr |= IRQ_NOAUTOEN;
+	/* Order is clear bits in "clr" then set bits in "set" */
+	irq_modify_status(irq, clr, set & ~clr);
 }
 
 void __init init_IRQ(void)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] arm: Use generic accessor in irq_set_flags()
  2011-02-07 22:56 [PATCH] arm: Use generic accessor in irq_set_flags() Thomas Gleixner
@ 2011-02-08  8:32 ` Uwe Kleine-König
  2011-02-08 23:12 ` Russell King - ARM Linux
  1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2011-02-08  8:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Thomas,

On Mon, Feb 07, 2011 at 11:56:47PM +0100, Thomas Gleixner wrote:
> The generic irq code provides an accessor function to manipulate
> status flags in the irq descriptor. Replace the open coded variant.
> 
> Neccecary to let the core code rearrange the internal representation.
s/Neccecary/Necessary/

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] arm: Use generic accessor in irq_set_flags()
  2011-02-07 22:56 [PATCH] arm: Use generic accessor in irq_set_flags() Thomas Gleixner
  2011-02-08  8:32 ` Uwe Kleine-König
@ 2011-02-08 23:12 ` Russell King - ARM Linux
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2011-02-08 23:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 07, 2011 at 11:56:47PM +0100, Thomas Gleixner wrote:
> The generic irq code provides an accessor function to manipulate
> status flags in the irq descriptor. Replace the open coded variant.
> 
> Neccecary to let the core code rearrange the internal representation.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-08 23:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-07 22:56 [PATCH] arm: Use generic accessor in irq_set_flags() Thomas Gleixner
2011-02-08  8:32 ` Uwe Kleine-König
2011-02-08 23:12 ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).