[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250207013117.104205-10-zhangzekun11@huawei.com>
Date: Fri, 7 Feb 2025 09:31:17 +0800
From: Zhang Zekun <zhangzekun11@...wei.com>
To: <robh@...nel.org>, <saravanak@...gle.com>, <justin.chen@...adcom.com>,
<florian.fainelli@...adcom.com>, <andrew+netdev@...n.ch>, <kuba@...nel.org>,
<o.rempel@...gutronix.de>, <kory.maincent@...tlin.com>,
<jacopo+renesas@...ndi.org>, <kieran.bingham+renesas@...asonboard.com>,
<laurent.pinchart+renesas@...asonboard.com>, <maddy@...ux.ibm.com>,
<mpe@...erman.id.au>, <npiggin@...il.com>, <olteanv@...il.com>,
<davem@...emloft.net>, <taras.chornyi@...ision.eu>, <edumazet@...gle.com>,
<pabeni@...hat.com>, <sudeep.holla@....com>, <cristian.marussi@....com>
CC: <arm-scmi@...r.kernel.org>, <linuxppc-dev@...ts.ozlabs.org>,
<linux-media@...r.kernel.org>, <netdev@...r.kernel.org>,
<devicetree@...r.kernel.org>, <chenjun102@...wei.com>,
<zhangzekun11@...wei.com>
Subject: [PATCH 9/9] regulator: scmi: Use of_find_node_by_name_balanced() to find device_node
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@...wei.com>
---
drivers/regulator/scmi-regulator.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c
index 9df726f10ad1..11f75c13bdf0 100644
--- a/drivers/regulator/scmi-regulator.c
+++ b/drivers/regulator/scmi-regulator.c
@@ -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 */
--
2.22.0
Powered by blists - more mailing lists