Commit b72de3ff authored by Damien Le Moal's avatar Damien Le Moal Committed by Linus Walleij

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: 96868dce ("gpio/sifive: Add GPIO driver for SiFive SoCs")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Link: https://lore.kernel.org/r/20201107081420.60325-10-damien.lemoal@wdc.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 45fe0b53
...@@ -183,7 +183,7 @@ static int sifive_gpio_probe(struct platform_device *pdev) ...@@ -183,7 +183,7 @@ static int sifive_gpio_probe(struct platform_device *pdev)
return PTR_ERR(chip->regs); return PTR_ERR(chip->regs);
ngpio = of_irq_count(node); 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", dev_err(dev, "Too many GPIO interrupts (max=%d)\n",
SIFIVE_GPIO_MAX); SIFIVE_GPIO_MAX);
return -ENXIO; return -ENXIO;
......
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