summaryrefslogtreecommitdiffstats
path: root/arch/frv/kernel/irq-mb93093.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-09-25 23:32:06 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 08:48:53 -0700
commit88d6e19900366781739df033e9c0e2532e715fa5 (patch)
tree97c6d48f0d707002c8239efb6e865a0133d69b68 /arch/frv/kernel/irq-mb93093.c
parent1bcbba306048ed86b935d57a95d887c23d52c94b (diff)
[PATCH] FRV: improve FRV's use of generic IRQ handling
Improve FRV's use of generic IRQ handling: (*) Use generic_handle_irq() rather than __do_IRQ() as the latter is obsolete. (*) Don't implement enable() and disable() ops as these will fall back to using unmask() and mask(). (*) Provide mask_ack() functions to avoid a call each to mask() and ack(). (*) Make the cascade handlers always return IRQ_HANDLED. (*) Implement the mask() and unmask() functions in the same order as they're listed in the ops table. Signed-off-by: David Howells <dhowells@redhat.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/frv/kernel/irq-mb93093.c')
-rw-r--r--arch/frv/kernel/irq-mb93093.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/arch/frv/kernel/irq-mb93093.c b/arch/frv/kernel/irq-mb93093.c
index f60db7988e7..a43a2215895 100644
--- a/arch/frv/kernel/irq-mb93093.c
+++ b/arch/frv/kernel/irq-mb93093.c
@@ -35,40 +35,44 @@
/*
* off-CPU FPGA PIC operations
*/
-static void frv_fpga_enable(unsigned int irq)
+static void frv_fpga_mask(unsigned int irq)
{
uint16_t imr = __get_IMR();
- imr &= ~(1 << (irq - IRQ_BASE_FPGA));
-
+ imr |= 1 << (irq - IRQ_BASE_FPGA);
__set_IMR(imr);
}
-static void frv_fpga_disable(unsigned int irq)
+static void frv_fpga_ack(unsigned int irq)
+{
+ __clr_IFR(1 << (irq - IRQ_BASE_FPGA));
+}
+
+static void frv_fpga_mask_ack(unsigned int irq)
{
uint16_t imr = __get_IMR();
imr |= 1 << (irq - IRQ_BASE_FPGA);
-
__set_IMR(imr);
-}
-static void frv_fpga_ack(unsigned int irq)
-{
__clr_IFR(1 << (irq - IRQ_BASE_FPGA));
}
-static void frv_fpga_end(unsigned int irq)
+static void frv_fpga_unmask(unsigned int irq)
{
+ uint16_t imr = __get_IMR();
+
+ imr &= ~(1 << (irq - IRQ_BASE_FPGA));
+
+ __set_IMR(imr);
}
static struct irq_chip frv_fpga_pic = {
.name = "mb93093",
- .enable = frv_fpga_enable,
- .disable = frv_fpga_disable,
.ack = frv_fpga_ack,
- .mask = frv_fpga_disable,
- .unmask = frv_fpga_enable,
+ .mask = frv_fpga_mask,
+ .mask_ack = frv_fpga_mask_ack,
+ .unmask = frv_fpga_unmask,
.end = frv_fpga_end,
};
@@ -78,7 +82,6 @@ static struct irq_chip frv_fpga_pic = {
static irqreturn_t fpga_interrupt(int irq, void *_mask, struct pt_regs *regs)
{
uint16_t imr, mask = (unsigned long) _mask;
- irqreturn_t iret = 0;
imr = __get_IMR();
mask = mask & ~imr & __get_IFR();
@@ -91,11 +94,10 @@ static irqreturn_t fpga_interrupt(int irq, void *_mask, struct pt_regs *regs)
irq = 31 - irq;
mask &= ~(1 << irq);
- if (__do_IRQ(IRQ_BASE_FPGA + irq, regs))
- iret |= IRQ_HANDLED;
+ generic_irq_handle(IRQ_BASE_FPGA + irq, regs);
}
- return iret;
+ return IRQ_HANDLED;
}
/*