diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-09-23 20:29:54 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-10-24 18:34:25 -0400 |
commit | fe5a8b7f0602b5a536d23cd3468461e9de76256b (patch) | |
tree | 4bd2f84494fc578c87a2327d60079151a12d586f /arch/mips/jz4740 | |
parent | 83bc769200802c9ce8fd1c7315fd14198d385b12 (diff) |
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 <lars@metafoo.de>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>
Patchwork: http://patchwork.linux-mips.org/patch/2432/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/jz4740')
-rw-r--r-- | arch/mips/jz4740/gpio.c | 8 |
1 files changed, 1 insertions, 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) | |||
301 | { | 301 | { |
302 | uint32_t flag; | 302 | uint32_t flag; |
303 | unsigned int gpio_irq; | 303 | unsigned int gpio_irq; |
304 | unsigned int gpio_bank; | ||
305 | struct jz_gpio_chip *chip = irq_desc_get_handler_data(desc); | 304 | struct jz_gpio_chip *chip = irq_desc_get_handler_data(desc); |
306 | 305 | ||
307 | gpio_bank = JZ4740_IRQ_GPIO0 - irq; | ||
308 | |||
309 | flag = readl(chip->base + JZ_REG_GPIO_FLAG); | 306 | flag = readl(chip->base + JZ_REG_GPIO_FLAG); |
310 | |||
311 | if (!flag) | 307 | if (!flag) |
312 | return; | 308 | return; |
313 | 309 | ||
314 | gpio_irq = __fls(flag); | 310 | gpio_irq = chip->irq_base + __fls(flag); |
315 | 311 | ||
316 | jz_gpio_check_trigger_both(chip, irq); | 312 | jz_gpio_check_trigger_both(chip, irq); |
317 | 313 | ||
318 | gpio_irq += (gpio_bank << 5) + JZ4740_IRQ_GPIO(0); | ||
319 | |||
320 | generic_handle_irq(gpio_irq); | 314 | generic_handle_irq(gpio_irq); |
321 | }; | 315 | }; |
322 | 316 | ||