Skip to content

Commit 57273ff

Browse files
juhosglinusw
authored andcommitted
pinctrl: armada-37xx: propagate error from armada_37xx_gpio_get()
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 0396a87 commit 57273ff

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
@@ -440,11 +440,14 @@ static int armada_37xx_gpio_get(struct gpio_chip *chip, unsigned int offset)
440440
struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
441441
unsigned int reg = INPUT_VAL;
442442
unsigned int val, mask;
443+
int ret;
443444

444445
armada_37xx_update_reg(&reg, &offset);
445446
mask = BIT(offset);
446447

447-
regmap_read(info->regmap, reg, &val);
448+
ret = regmap_read(info->regmap, reg, &val);
449+
if (ret)
450+
return ret;
448451

449452
return (val & mask) != 0;
450453
}

0 commit comments

Comments
 (0)