diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-04-16 23:43:41 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-07-19 16:21:34 +0200 |
commit | 727fb7083e658d58441558cab8dacc749be51aad (patch) | |
tree | 1bee3d23eb3e8bb04378f59f1176fe7cf7d9a1e6 | |
parent | c316bde418af4c2a9df51149ed01d1bd8ca5bebf (diff) | |
download | linux-stable-727fb7083e658d58441558cab8dacc749be51aad.tar.gz linux-stable-727fb7083e658d58441558cab8dacc749be51aad.tar.bz2 linux-stable-727fb7083e658d58441558cab8dacc749be51aad.zip |
pinctrl: bcm2835: Handle gpiochip_add_pin_range() errors
[ Upstream commit cdf7e616120065007687fe1df0412154f259daec ]
gpiochip_add_pin_range() can fail, so better return its error code than
a hard coded '0'.
Fixes: d2b67744fd99 ("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>
-rw-r--r-- | drivers/pinctrl/bcm/pinctrl-bcm2835.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 0f1ab0829ffe..fe8da3ccb0b5 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -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, - gc->ngpio); - - return 0; + return gpiochip_add_pin_range(gc, pinctrl_dev_get_devname(pctldev), 0, 0, + gc->ngpio); } static const struct gpio_chip bcm2835_gpio_chip = { |