Commit 88d60d7d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: pistachio: Correct the fwnode_irq_get() return value check

fwnode_irq_get() may return all possible signed values, such as Linux
error code or 0. Fix the code to handle this properly.

Fixes: 1074e1d2 ("pinctrl: pistachio: Switch to use fwnode instead of")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220908094323.31965-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 1a41d1e5
......@@ -1374,8 +1374,14 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
ret = fwnode_irq_get(child, 0);
if (ret < 0) {
fwnode_handle_put(child);
dev_err(pctl->dev, "Failed to retrieve IRQ for bank %u\n", i);
goto err;
}
if (!ret) {
fwnode_handle_put(child);
dev_err(pctl->dev, "No IRQ for bank %u\n", i);
ret = -EINVAL;
goto err;
}
irq = ret;
......
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