Commit dd72a3b8 authored by Rob Herring (Arm)'s avatar Rob Herring (Arm) Committed by Mark Brown

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: default avatarRob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20240828130056.3481050-2-robh@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7540bd33
...@@ -2577,15 +2577,13 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev) ...@@ -2577,15 +2577,13 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
if (saw_regmap) { if (saw_regmap) {
reg_node = of_get_child_by_name(node, reg->name); reg_node = of_get_child_by_name(node, reg->name);
reg_prop = of_find_property(reg_node, "qcom,saw-leader", if (of_property_read_bool(reg_node, "qcom,saw-leader")) {
&lenp);
of_node_put(reg_node);
if (reg_prop) {
spmi_saw_ops = *(vreg->desc.ops); spmi_saw_ops = *(vreg->desc.ops);
spmi_saw_ops.set_voltage_sel = spmi_saw_ops.set_voltage_sel =
spmi_regulator_saw_set_voltage; spmi_regulator_saw_set_voltage;
vreg->desc.ops = &spmi_saw_ops; vreg->desc.ops = &spmi_saw_ops;
} }
of_node_put(reg_node);
} }
if (vreg->set_points && vreg->set_points->count == 1) { if (vreg->set_points && vreg->set_points->count == 1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment