Thread (10 messages) 10 messages, 4 authors, 2025-05-21

Re: [PATCH 3/6] ASoC: renesas: Use helper function for_each_child_of_node_scoped()

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: 2025-05-21 23:43:38
Also in: imx, linux-amlogic, linux-arm-kernel, linux-arm-msm, linux-renesas-soc, linux-sound, lkml

Hi Ai

Thank you for the patch
The for_each_child_of_node_scoped() helper provides a scope-based
clean-up functionality to put the device_node automatically, and
as such, there is no need to call of_node_put() directly.

Thus, use this helper to simplify the code.

Signed-off-by: Ai Chao <redacted>
---
(snip)
quoted hunk ↗ jump to hunk
@@ -1270,16 +1263,15 @@ static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph)
 
 	of_node_put(node);
 
-	for_each_child_of_node(np, node) {
-		if (!of_node_name_eq(node, RSND_NODE_DAI))
+	for_each_child_of_node_scoped(np, ports) {
+		if (!of_node_name_eq(ports, RSND_NODE_DAI))
 			continue;
 
-		priv->component_dais[i] = of_get_child_count(node);
+		priv->component_dais[i] = of_get_child_count(ports);
 		nr += priv->component_dais[i];
 		i++;
 		if (i >= RSND_MAX_COMPONENT) {
 			dev_info(dev, "reach to max component\n");
-			of_node_put(node);
 			break;
 		}
 	}
Here changes "node" to "ports", but please keep "node".
Here is checking "node" instead of "ports".

Except this

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help