mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 21:50:53 +07:00
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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
8d72a7fc8d
commit
316b255001
@ -207,9 +207,9 @@ static int gpio_pin_to_irq(struct gpio_chip *gc, unsigned offset)
|
||||
unsigned int i, k;
|
||||
|
||||
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)
|
||||
return pfc->info->gpio_irq[i].irq;
|
||||
}
|
||||
|
@ -94,11 +94,11 @@ struct pinmux_data_reg {
|
||||
|
||||
struct pinmux_irq {
|
||||
int irq;
|
||||
unsigned short *gpios;
|
||||
short *gpios;
|
||||
};
|
||||
|
||||
#define PINMUX_IRQ(irq_nr, ids...) \
|
||||
{ .irq = irq_nr, .gpios = (unsigned short []) { ids, 0 } } \
|
||||
{ .irq = irq_nr, .gpios = (short []) { ids, -1 } }
|
||||
|
||||
struct pinmux_range {
|
||||
u16 begin;
|
||||
|
Loading…
Reference in New Issue
Block a user