pinctrl: bcm2835: Handle gpiochip_add_pin_range() errors

[ Upstream commit cdf7e61612 ]

gpiochip_add_pin_range() can fail, so better return its error code than
a hard coded '0'.

Fixes: d2b67744fd ("pinctrl: bcm2835: implement hook for missing gpio-ranges")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/98c3b5890bb72415145c9fe4e1d974711edae376.1681681402.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Christophe JAILLET 2023-04-16 23:43:41 +02:00 committed by Greg Kroah-Hartman
parent c316bde418
commit 727fb7083e
1 changed files with 2 additions and 4 deletions

View File

@ -376,10 +376,8 @@ static int bcm2835_of_gpio_ranges_fallback(struct gpio_chip *gc,
if (!pctldev)
return 0;
gpiochip_add_pin_range(gc, pinctrl_dev_get_devname(pctldev), 0, 0,
return gpiochip_add_pin_range(gc, pinctrl_dev_get_devname(pctldev), 0, 0,
gc->ngpio);
return 0;
}
static const struct gpio_chip bcm2835_gpio_chip = {