diff options
author | David Howells <dhowells@redhat.com> | 2006-09-25 23:32:06 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 08:48:53 -0700 |
commit | 88d6e19900366781739df033e9c0e2532e715fa5 (patch) | |
tree | 97c6d48f0d707002c8239efb6e865a0133d69b68 /arch/frv/kernel/irq-mb93091.c | |
parent | 1bcbba306048ed86b935d57a95d887c23d52c94b (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-mb93091.c')
-rw-r--r-- | arch/frv/kernel/irq-mb93091.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/arch/frv/kernel/irq-mb93091.c b/arch/frv/kernel/irq-mb93091.c index 635d2343766..369bc0a7443 100644 --- a/arch/frv/kernel/irq-mb93091.c +++ b/arch/frv/kernel/irq-mb93091.c @@ -36,41 +36,45 @@ /* * on-motherboard 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 = "mb93091", - .enable = frv_fpga_enable, - .disable = frv_fpga_disable, .ack = frv_fpga_ack, - .mask = frv_fpga_disable, - .unmask = frv_fpga_enable, - .end = frv_fpga_end, + .mask = frv_fpga_mask, + .mask_ack = frv_fpga_mask_ack, + .unmask = frv_fpga_unmask, }; /* @@ -79,7 +83,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(); @@ -92,11 +95,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_handle_irq(IRQ_BASE_FPGA + irq, regs); } - return iret; + return IRQ_HANDLED; } /* |