summaryrefslogtreecommitdiff
path: root/drivers/regulator/tps62360-regulator.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 17:47:22 +0300
committerMark Brown <broonie@kernel.org>2023-03-11 15:13:42 +0300
commit5bd73a162bc881dbb98ff9909dd865286852ee2b (patch)
tree75c47e308b8be46a7a2f2454b6c3b8441894956c /drivers/regulator/tps62360-regulator.c
parent7dda20c97fac52948b948e15e1173ee57c66ed35 (diff)
downloadlinux-5bd73a162bc881dbb98ff9909dd865286852ee2b.tar.xz
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/tps62360-regulator.c')
-rw-r--r--drivers/regulator/tps62360-regulator.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c
index da1b2b1341ae..a7019e869f50 100644
--- a/drivers/regulator/tps62360-regulator.c
+++ b/drivers/regulator/tps62360-regulator.c
@@ -296,17 +296,10 @@ static struct tps62360_regulator_platform_data *
return NULL;
}
- if (of_find_property(np, "ti,vsel0-state-high", NULL))
- pdata->vsel0_def_state = 1;
-
- if (of_find_property(np, "ti,vsel1-state-high", NULL))
- pdata->vsel1_def_state = 1;
-
- if (of_find_property(np, "ti,enable-pull-down", NULL))
- pdata->en_internal_pulldn = true;
-
- if (of_find_property(np, "ti,enable-vout-discharge", NULL))
- pdata->en_discharge = true;
+ pdata->vsel0_def_state = of_property_read_bool(np, "ti,vsel0-state-high");
+ pdata->vsel1_def_state = of_property_read_bool(np, "ti,vsel1-state-high");
+ pdata->en_internal_pulldn = of_property_read_bool(np, "ti,enable-pull-down");
+ pdata->en_discharge = of_property_read_bool(np, "ti,enable-vout-discharge");
return pdata;
}