Skip to content

Commit bfa0ff8

Browse files
juhosglinusw
authored andcommitted
pinctrl: armada-37xx: propagate error from armada_37xx_pmx_gpio_set_direction()
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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Gabor Juhos <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 57273ff commit bfa0ff8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/pinctrl/mvebu/pinctrl-armada-37xx.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,16 +472,17 @@ static int armada_37xx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
472472
{
473473
struct armada_37xx_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
474474
struct gpio_chip *chip = range->gc;
475+
int ret;
475476

476477
dev_dbg(info->dev, "gpio_direction for pin %u as %s-%d to %s\n",
477478
offset, range->name, offset, input ? "input" : "output");
478479

479480
if (input)
480-
armada_37xx_gpio_direction_input(chip, offset);
481+
ret = armada_37xx_gpio_direction_input(chip, offset);
481482
else
482-
armada_37xx_gpio_direction_output(chip, offset, 0);
483+
ret = armada_37xx_gpio_direction_output(chip, offset, 0);
483484

484-
return 0;
485+
return ret;
485486
}
486487

487488
static int armada_37xx_gpio_request_enable(struct pinctrl_dev *pctldev,

0 commit comments

Comments
 (0)