]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pinctrl: armada-37xx: propagate error from armada_37xx_pmx_gpio_set_direction()
authorGabor Juhos <j4g8y7@gmail.com>
Wed, 14 May 2025 19:18:36 +0000 (21:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:04:18 +0000 (11:04 +0100)
[ Upstream commit bfa0ff804ffa8b1246ade8be08de98c9eb19d16f ]

The armada_37xx_gpio_direction_{in,out}put() functions can fail, so
propagate their error values back to the stack instead of silently
ignoring those.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-5-07e9ac1ab737@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c

index 1cb3bcb41684e330c9c12e75c86fec15c315c93c..bd3eebf564236f0f873d2d91d0535b2eae8aef4e 100644 (file)
@@ -468,16 +468,17 @@ static int armada_37xx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
 {
        struct armada_37xx_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
        struct gpio_chip *chip = range->gc;
+       int ret;
 
        dev_dbg(info->dev, "gpio_direction for pin %u as %s-%d to %s\n",
                offset, range->name, offset, input ? "input" : "output");
 
        if (input)
-               armada_37xx_gpio_direction_input(chip, offset);
+               ret = armada_37xx_gpio_direction_input(chip, offset);
        else
-               armada_37xx_gpio_direction_output(chip, offset, 0);
+               ret = armada_37xx_gpio_direction_output(chip, offset, 0);
 
-       return 0;
+       return ret;
 }
 
 static int armada_37xx_gpio_request_enable(struct pinctrl_dev *pctldev,