projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c06f08
)
pinctrl: apple: handle regmap_read errors
author
Joey Gouly
<joey.gouly@arm.com>
Sun, 21 Nov 2021 16:56:36 +0000
(16:56 +0000)
committer
Linus Walleij
<linus.walleij@linaro.org>
Fri, 26 Nov 2021 23:55:14 +0000
(
00:55
+0100)
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>
drivers/pinctrl/pinctrl-apple-gpio.c
patch
|
blob
|
history
diff --git
a/drivers/pinctrl/pinctrl-apple-gpio.c
b/drivers/pinctrl/pinctrl-apple-gpio.c
index
cce9536
..
bd7f281
100644
(file)
--- a/
drivers/pinctrl/pinctrl-apple-gpio.c
+++ b/
drivers/pinctrl/pinctrl-apple-gpio.c
@@
-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);
}
-static u
int32_t
apple_gpio_get_reg(struct apple_gpio_pinctrl *pctl,
+static u
32
apple_gpio_get_reg(struct apple_gpio_pinctrl *pctl,
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;
}