summaryrefslogtreecommitdiff
path: root/drivers/regulator/max8997-regulator.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 08:47:22 -0600
committerMark Brown <broonie@kernel.org>2023-03-11 12:13:42 +0000
commit5bd73a162bc881dbb98ff9909dd865286852ee2b (patch)
tree75c47e308b8be46a7a2f2454b6c3b8441894956c /drivers/regulator/max8997-regulator.c
parent7dda20c97fac52948b948e15e1173ee57c66ed35 (diff)
downloadlwn-5bd73a162bc881dbb98ff9909dd865286852ee2b.tar.gz
lwn-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/max8997-regulator.c')
-rw-r--r--drivers/regulator/max8997-regulator.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/regulator/max8997-regulator.c b/drivers/regulator/max8997-regulator.c
index ba47a5e2fbcb..829c3d9542af 100644
--- a/drivers/regulator/max8997-regulator.c
+++ b/drivers/regulator/max8997-regulator.c
@@ -943,14 +943,9 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
}
of_node_put(regulators_np);
- if (of_get_property(pmic_np, "max8997,pmic-buck1-uses-gpio-dvs", NULL))
- pdata->buck1_gpiodvs = true;
-
- if (of_get_property(pmic_np, "max8997,pmic-buck2-uses-gpio-dvs", NULL))
- pdata->buck2_gpiodvs = true;
-
- if (of_get_property(pmic_np, "max8997,pmic-buck5-uses-gpio-dvs", NULL))
- pdata->buck5_gpiodvs = true;
+ pdata->buck1_gpiodvs = of_property_read_bool(pmic_np, "max8997,pmic-buck1-uses-gpio-dvs");
+ pdata->buck2_gpiodvs = of_property_read_bool(pmic_np, "max8997,pmic-buck2-uses-gpio-dvs");
+ pdata->buck5_gpiodvs = of_property_read_bool(pmic_np, "max8997,pmic-buck5-uses-gpio-dvs");
if (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs ||
pdata->buck5_gpiodvs) {