diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 15:47:22 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-03-11 13:13:42 +0100 |
commit | 5bd73a162bc881dbb98ff9909dd865286852ee2b (patch) | |
tree | 75c47e308b8be46a7a2f2454b6c3b8441894956c /drivers/regulator/lp872x.c | |
parent | regulator: Use of_property_present() for testing DT property presence (diff) | |
download | linux-5bd73a162bc881dbb98ff9909dd865286852ee2b.tar.xz linux-5bd73a162bc881dbb98ff9909dd865286852ee2b.zip |
regulator: Use of_property_read_bool() for boolean properties
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230310144722.1544843-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/lp872x.c')
-rw-r--r-- | drivers/regulator/lp872x.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c index c576894c3d52..b5d83a63991b 100644 --- a/drivers/regulator/lp872x.c +++ b/drivers/regulator/lp872x.c @@ -832,8 +832,7 @@ static struct lp872x_platform_data return ERR_PTR(-ENOMEM); of_property_read_u8(np, "ti,general-config", &pdata->general_config); - if (of_find_property(np, "ti,update-config", NULL)) - pdata->update_config = true; + pdata->update_config = of_property_read_bool(np, "ti,update-config"); pdata->dvs = devm_kzalloc(dev, sizeof(struct lp872x_dvs), GFP_KERNEL); if (!pdata->dvs) |