summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorRob Herring (Arm) <robh@kernel.org>2024-08-28 08:00:55 -0500
committerMark Brown <broonie@kernel.org>2024-08-28 21:52:45 +0100
commitdd72a3b8a6007b44ed3b85e1d606afc434879e70 (patch)
treed82253180568dd899ea9030d4f4e34d407571215 /drivers/regulator
parent7540bd3398675e54cbd7324c47be8cd3c7a6d9c5 (diff)
regulator: qcom_spmi: Use of_property_read_bool()
Use of_property_read_bool() to read boolean properties rather than of_find_property(). This is part of a larger effort to remove callers of of_find_property() and similar functions. of_find_property() leaks the DT property pointer which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240828130056.3481050-2-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/qcom_spmi-regulator.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index 68603649db48..89657e8eea82 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -2577,15 +2577,13 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
if (saw_regmap) {
reg_node = of_get_child_by_name(node, reg->name);
- reg_prop = of_find_property(reg_node, "qcom,saw-leader",
- &lenp);
- of_node_put(reg_node);
- if (reg_prop) {
+ if (of_property_read_bool(reg_node, "qcom,saw-leader")) {
spmi_saw_ops = *(vreg->desc.ops);
spmi_saw_ops.set_voltage_sel =
spmi_regulator_saw_set_voltage;
vreg->desc.ops = &spmi_saw_ops;
}
+ of_node_put(reg_node);
}
if (vreg->set_points && vreg->set_points->count == 1) {