Commit 316b2550 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Linus Walleij

sh-pfc: Terminate gpios array by -1

0 is a valid GPIO value, use -1 to terminate the gpios array in IRQ
lists.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: default avatarMagnus Damm <damm@opensource.se>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 8d72a7fc
...@@ -207,9 +207,9 @@ static int gpio_pin_to_irq(struct gpio_chip *gc, unsigned offset) ...@@ -207,9 +207,9 @@ static int gpio_pin_to_irq(struct gpio_chip *gc, unsigned offset)
unsigned int i, k; unsigned int i, k;
for (i = 0; i < pfc->info->gpio_irq_size; i++) { for (i = 0; i < pfc->info->gpio_irq_size; i++) {
unsigned short *gpios = pfc->info->gpio_irq[i].gpios; short *gpios = pfc->info->gpio_irq[i].gpios;
for (k = 0; gpios[k]; k++) { for (k = 0; gpios[k] >= 0; k++) {
if (gpios[k] == offset) if (gpios[k] == offset)
return pfc->info->gpio_irq[i].irq; return pfc->info->gpio_irq[i].irq;
} }
......
...@@ -94,11 +94,11 @@ struct pinmux_data_reg { ...@@ -94,11 +94,11 @@ struct pinmux_data_reg {
struct pinmux_irq { struct pinmux_irq {
int irq; int irq;
unsigned short *gpios; short *gpios;
}; };
#define PINMUX_IRQ(irq_nr, ids...) \ #define PINMUX_IRQ(irq_nr, ids...) \
{ .irq = irq_nr, .gpios = (unsigned short []) { ids, 0 } } \ { .irq = irq_nr, .gpios = (short []) { ids, -1 } }
struct pinmux_range { struct pinmux_range {
u16 begin; u16 begin;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment