Skip to content

Commit 6481c0a

Browse files
juhosglinusw
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 <[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 bfa0ff8 commit 6481c0a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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)