<div class="viewer_part" style="position: relative;">
<div>Hi Johannes:<br><br>> Given the structure of this code, this either fixes a leak, or is wrong.<br>> I really don't know which of those two it is, it's been decades, but<br>> either way it's not a change that simply "simplif[ies] the code".<br><br>About for_each_child_of_node() in file of.h :<br><br>#define for_each_child_of_node(parent, child) \<br> for (child = of_get_next_child(parent, NULL); child != NULL; \<br> child = of_get_next_child(parent, child))<br><br>of_get_next_child() will used of_node_get() increment refcount of a node.<br><br>So, we need used of_node_put() to decrement refcount of a node.<br><br>And the for_each_child_of_node_scoped() helper provides a scope-based <br>clean-up functionality to put the device_node automatically, and as <br>such, there is no need to call of_node_put() directly.<br><br>"simplifies the code" is no need to callof_node_put() .<br><br><br><br>-- <br>With best wishes<br>Ai Chao<br><br></div>
</div>
<p> </p>
<p> </p>
<p>----</p>
<div id="cs2c_mail_sigature"></div>
<p> </p>
<p> </p>
<p> </p>