1 From bfa0ff804ffa8b1246ade8be08de98c9eb19d16f Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <j4g8y7@gmail.com>
3 Date: Wed, 14 May 2025 21:18:36 +0200
4 Subject: [PATCH 5/7] pinctrl: armada-37xx: propagate error from
5 armada_37xx_pmx_gpio_set_direction()
7 The armada_37xx_gpio_direction_{in,out}put() functions can fail, so
8 propagate their error values back to the stack instead of silently
11 Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
12 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
13 Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
14 Link: https://lore.kernel.org/20250514-pinctrl-a37xx-fixes-v2-5-07e9ac1ab737@gmail.com
15 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
17 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 7 ++++---
18 1 file changed, 4 insertions(+), 3 deletions(-)
20 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
21 +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
22 @@ -472,16 +472,17 @@ static int armada_37xx_pmx_gpio_set_dire
24 struct armada_37xx_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
25 struct gpio_chip *chip = range->gc;
28 dev_dbg(info->dev, "gpio_direction for pin %u as %s-%d to %s\n",
29 offset, range->name, offset, input ? "input" : "output");
32 - armada_37xx_gpio_direction_input(chip, offset);
33 + ret = armada_37xx_gpio_direction_input(chip, offset);
35 - armada_37xx_gpio_direction_output(chip, offset, 0);
36 + ret = armada_37xx_gpio_direction_output(chip, offset, 0);
42 static int armada_37xx_gpio_request_enable(struct pinctrl_dev *pctldev,