mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
pinctrl: armada-37xx: propagate error from armada_37xx_gpio_get()
[ Upstream commit 57273ff8bb16f3842c2597b5bbcd49e7fa12edf7 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
e29b3da920
commit
7db634f5f6
1 changed files with 4 additions and 1 deletions
|
|
@ -435,11 +435,14 @@ static int armada_37xx_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
|||
struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
|
||||
unsigned int reg = INPUT_VAL;
|
||||
unsigned int val, mask;
|
||||
int ret;
|
||||
|
||||
armada_37xx_update_reg(®, &offset);
|
||||
mask = BIT(offset);
|
||||
|
||||
regmap_read(info->regmap, reg, &val);
|
||||
ret = regmap_read(info->regmap, reg, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return (val & mask) != 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue