summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-sifive.c
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@wdc.com>2020-11-07 11:13:57 +0300
committerLinus Walleij <linus.walleij@linaro.org>2020-11-11 11:53:09 +0300
commitb72de3ff19fdc4bbe4d4bb3f4483c7e46e00bac3 (patch)
treefd140c35ccfefce381cb4acf5188b340248f6216 /drivers/gpio/gpio-sifive.c
parent45fe0b539bc9cf6a6832d0d60cb6eab1e5f56bd9 (diff)
downloadlinux-b72de3ff19fdc4bbe4d4bb3f4483c7e46e00bac3.tar.xz
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: 96868dce644d ("gpio/sifive: Add GPIO driver for SiFive SoCs") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Link: https://lore.kernel.org/r/20201107081420.60325-10-damien.lemoal@wdc.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-sifive.c')
-rw-r--r--drivers/gpio/gpio-sifive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c
index c54dd08f2cbf..d5eb9ca11901 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;