[PATCH 3/7] pinctrl: rockchip: use of_property_read_bool()
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Jul 1 00:32:16 PDT 2024
No Rockchip device tree actually sets a value for these properties and
neither kernel or barebox driver cares about the property value.
Thus replace of_property_read_u32 with of_property_read_bool for
simplification.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
drivers/pinctrl/pinctrl-rockchip.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index d80ac7d5dc04..4276c578a6cc 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -230,13 +230,11 @@ static struct rockchip_pinctrl *to_rockchip_pinctrl(struct pinctrl_device *pdev)
static enum pin_config_param parse_bias_config(struct device_node *np)
{
- u32 val;
-
- if (of_property_read_u32(np, "bias-pull-up", &val) != -EINVAL)
+ if (of_property_read_bool(np, "bias-pull-up"))
return PIN_CONFIG_BIAS_PULL_UP;
- else if (of_property_read_u32(np, "bias-pull-down", &val) != -EINVAL)
+ else if (of_property_read_bool(np, "bias-pull-down"))
return PIN_CONFIG_BIAS_PULL_DOWN;
- else if (of_property_read_u32(np, "bias-bus-hold", &val) != -EINVAL)
+ else if (of_property_read_bool(np, "bias-bus-hold"))
return PIN_CONFIG_BIAS_BUS_HOLD;
else
return PIN_CONFIG_BIAS_DISABLE;
--
2.39.2
More information about the barebox
mailing list