[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <22dfeb0b-c3ff-4a7a-8471-1bb89dccdc17@kylinos.cn>
Date: Fri, 30 May 2025 17:30:58 +0800
From: Ai Chao <aichao@...inos.cn>
To: Johannes Berg <johannes@...solutions.net>, perex <perex@...ex.cz>,
tiwai <tiwai@...e.com>,
"kuninori.morimoto.gx" <kuninori.morimoto.gx@...esas.com>,
lgirdwood <lgirdwood@...il.com>, broonie <broonie@...nel.org>,
jbrunet <jbrunet@...libre.com>, "neil.armstrong"
<neil.armstrong@...aro.org>, khilman <khilman@...libre.com>,
"martin.blumenstingl" <martin.blumenstingl@...glemail.com>,
"shengjiu.wang" <shengjiu.wang@...il.com>, "Xiubo.Lee"
<Xiubo.Lee@...il.com>, festevam <festevam@...il.com>,
nicoleotsuka <nicoleotsuka@...il.com>, shawnguo <shawnguo@...nel.org>,
"s.hauer" <s.hauer@...gutronix.de>,
"srinivas.kandagatla" <srinivas.kandagatla@...aro.org>
Cc: linux-sound <linux-sound@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
linux-renesas-soc <linux-renesas-soc@...r.kernel.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-amlogic <linux-amlogic@...ts.infradead.org>, imx
<imx@...ts.linux.dev>, kernel <kernel@...gutronix.de>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH v2 2/6] ASoC: aoa: Use helper function
for_each_child_of_node_scoped()
Hi Johannes:
Thanks for your feedback. I will drop it.
> On Mon, 2025-05-26 at 16:20 +0800, Ai Chao wrote:
>> Hi Johannes:
>>>> for_each_child_of_node.
>>> You still haven't explained why it's even correct.
>>>
>>> johannes
>> The for_each_child_of_node() function is used to iterate over all child
>> nodes of a device tree node.
>> During each iteration, it retrieves a pointer to the child node via
>> of_get_next_child() and automatically increments the node's reference
>> count (of_node_get()).
>> Each call to of_get_next_child() increases the reference count
>> (refcount) of the returned child node, ensuring that the node is not
>> freed while in use.
>> for_each_child_of_node() increments the child node's reference count in
>> each iteration but does not decrement it automatically.
>> If of_node_put() is not called manually, the reference count will never
>> reach zero, resulting in a memory leak of the node.
> Yes, good! Now show that you can apply what you've learned to the
> specific code (and changes) at hand.
>
> johannes
--
Best regards,
Ai Chao
Powered by blists - more mailing lists