@@ -339,8 +339,7 @@ static int scmi_regulator_probe(struct scmi_device *sdev)
* plausible SCMI Voltage Domain number, all belonging to this SCMI
* platform instance node (handle->dev->of_node).
*/
- of_node_get(handle->dev->of_node);
- np = of_find_node_by_name(handle->dev->of_node, "regulators");
+ np = of_find_node_by_name_balanced(handle->dev->of_node, "regulators");
for_each_child_of_node_scoped(np, child) {
ret = process_scmi_regulator_of_node(sdev, ph, child, rinfo);
/* abort on any mem issue */
Instead of directly using of_node_get() before of_find_node_by_name() to balance the refcount of the device_node, using wraper function of_find_node_by_name_balanced() to make code logic a bit simplier. Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> --- drivers/regulator/scmi-regulator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)