Skip to content

Commit

Permalink
MIPS: JZ4740: GPIO: Simplify IRQ demuxer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars-Peter Clausen authored and Ralf Baechle committed Oct 24, 2011
1 parent 83bc769 commit fe5a8b7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions arch/mips/jz4740/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit fe5a8b7

Please sign in to comment.