mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
pinctrl: apple: handle regmap_read errors
Explicitly return 0 if the regmap_read fails. Also change a uint32_t to a u32. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20211121165642.27883-6-joey.gouly@arm.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
7c06f080dd
commit
3605f10411
1 changed files with 7 additions and 3 deletions
|
@ -81,12 +81,16 @@ static void apple_gpio_set_reg(struct apple_gpio_pinctrl *pctl,
|
||||||
regmap_update_bits(pctl->map, REG_GPIO(pin), mask, value);
|
regmap_update_bits(pctl->map, REG_GPIO(pin), mask, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t apple_gpio_get_reg(struct apple_gpio_pinctrl *pctl,
|
static u32 apple_gpio_get_reg(struct apple_gpio_pinctrl *pctl,
|
||||||
unsigned int pin)
|
unsigned int pin)
|
||||||
{
|
{
|
||||||
unsigned int val = 0;
|
int ret;
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
ret = regmap_read(pctl->map, REG_GPIO(pin), &val);
|
||||||
|
if (ret)
|
||||||
|
return 0;
|
||||||
|
|
||||||
regmap_read(pctl->map, REG_GPIO(pin), &val);
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue