lkml.org 
[lkml]   [2019]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 2/4] net: phy: Add support for generic LED configuration through the DT
> +	for_each_child_of_node(np, child) {
> + u32 led;
> +
> + if (of_property_read_u32(child, "reg", &led))
> + goto skip_config;


> +
> + skip_config:
> + of_node_put(child);

There is no need for this put. So long as you don't break out of
for_each_child_of_node() with a return, it will correctly release
child at the end of each loop. A continue statement is also O.K.

Andrew

\
 
 \ /
  Last update: 2019-08-07 20:18    [W:0.074 / U:1.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site