From fe5a8b7f0602b5a536d23cd3468461e9de76256b Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 24 Sep 2011 02:29:54 +0200 Subject: MIPS: JZ4740: GPIO: Simplify IRQ demuxer We already know the base IRQ for a GPIO chip, so there is no need to recalculate it in the demux handler. Signed-off-by: Lars-Peter Clausen Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Cc: Lars-Peter Clausen Patchwork: http://patchwork.linux-mips.org/patch/2432/ Signed-off-by: Ralf Baechle --- arch/mips/jz4740/gpio.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c index 415d7d7e3283..bbbe12ba60ab 100644 --- a/arch/mips/jz4740/gpio.c +++ b/arch/mips/jz4740/gpio.c @@ -301,22 +301,16 @@ static void jz_gpio_irq_demux_handler(unsigned int irq, struct irq_desc *desc) { uint32_t flag; unsigned int gpio_irq; - unsigned int gpio_bank; struct jz_gpio_chip *chip = irq_desc_get_handler_data(desc); - gpio_bank = JZ4740_IRQ_GPIO0 - irq; - flag = readl(chip->base + JZ_REG_GPIO_FLAG); - if (!flag) return; - gpio_irq = __fls(flag); + gpio_irq = chip->irq_base + __fls(flag); jz_gpio_check_trigger_both(chip, irq); - gpio_irq += (gpio_bank << 5) + JZ4740_IRQ_GPIO(0); - generic_handle_irq(gpio_irq); }; -- cgit v1.2.3