From: Damien Le Moal Date: Sat, 7 Nov 2020 08:13:57 +0000 (+0900) Subject: gpio: sifive: Fix SiFive gpio probe X-Git-Tag: baikal/mips/sdk5.9~12239^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=5666614b81d831f00d7cffd15ec301b624eb0fdf;p=kernel.git gpio: sifive: Fix SiFive gpio probe Fix the check on the number of IRQs to allow up to the maximum (32) instead of only the maximum minus one. Fixes: 5b9c9efece06 ("gpio/sifive: Add GPIO driver for SiFive SoCs") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20201107081420.60325-10-damien.lemoal@wdc.com Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c index c54dd08f2cbfd..d5eb9ca119016 100644 --- a/drivers/gpio/gpio-sifive.c +++ b/drivers/gpio/gpio-sifive.c @@ -183,7 +183,7 @@ static int sifive_gpio_probe(struct platform_device *pdev) return PTR_ERR(chip->regs); ngpio = of_irq_count(node); - if (ngpio >= SIFIVE_GPIO_MAX) { + if (ngpio > SIFIVE_GPIO_MAX) { dev_err(dev, "Too many GPIO interrupts (max=%d)\n", SIFIVE_GPIO_MAX); return -ENXIO;