Commit ad646394 authored by 蒋家盛's avatar 蒋家盛 Committed by Linus Walleij
Browse files

pinctrl: npcm7xx: Add missing check for ioremap



Add check for ioremap() and return the error if it fails in order to
guarantee the success of ioremap().

Fixes: 3b588e43 ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230607095829.1345-1-jiasheng@iscas.ac.cn


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 73f8ce7f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1884,6 +1884,8 @@ static int npcm7xx_gpio_of(struct npcm7xx_pinctrl *pctrl)
		}

		pctrl->gpio_bank[id].base = ioremap(res.start, resource_size(&res));
		if (!pctrl->gpio_bank[id].base)
			return -EINVAL;

		ret = bgpio_init(&pctrl->gpio_bank[id].gc, dev, 4,
				 pctrl->gpio_bank[id].base + NPCM7XX_GP_N_DIN,