Skip to content

Commit 6481c0a

Browse files
juhosgLinus Walleij
authored andcommitted
pinctrl: armada-37xx: propagate error from armada_37xx_gpio_get_direction()
The regmap_read() function can fail, so propagate its error up to the stack instead of silently ignoring that. 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-6-07e9ac1ab737@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent bfa0ff8 commit 6481c0a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,13 @@ static int armada_37xx_gpio_get_direction(struct gpio_chip *chip,
402402
struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
403403
unsigned int reg = OUTPUT_EN;
404404
unsigned int val, mask;
405+
int ret;
405406

406407
armada_37xx_update_reg(&reg, &offset);
407408
mask = BIT(offset);
408-
regmap_read(info->regmap, reg, &val);
409+
ret = regmap_read(info->regmap, reg, &val);
410+
if (ret)
411+
return ret;
409412

410413
if (val & mask)
411414
return GPIO_LINE_DIRECTION_OUT;

0 commit comments

Comments
 (0)