File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ static int node_name_cmp(const struct device_node *dn1,
150
150
static int adjust_local_phandle_references (struct device_node * local_fixups ,
151
151
struct device_node * overlay , int phandle_delta )
152
152
{
153
- struct device_node * child , * overlay_child ;
153
+ struct device_node * overlay_child ;
154
154
struct property * prop_fix , * prop ;
155
155
int err , i , count ;
156
156
unsigned int off ;
@@ -194,25 +194,21 @@ static int adjust_local_phandle_references(struct device_node *local_fixups,
194
194
* The roots of the subtrees are the overlay's __local_fixups__ node
195
195
* and the overlay's root node.
196
196
*/
197
- for_each_child_of_node (local_fixups , child ) {
197
+ for_each_child_of_node_scoped (local_fixups , child ) {
198
198
199
199
for_each_child_of_node (overlay , overlay_child )
200
200
if (!node_name_cmp (child , overlay_child )) {
201
201
of_node_put (overlay_child );
202
202
break ;
203
203
}
204
204
205
- if (!overlay_child ) {
206
- of_node_put (child );
205
+ if (!overlay_child )
207
206
return - EINVAL ;
208
- }
209
207
210
208
err = adjust_local_phandle_references (child , overlay_child ,
211
209
phandle_delta );
212
- if (err ) {
213
- of_node_put (child );
210
+ if (err )
214
211
return err ;
215
- }
216
212
}
217
213
218
214
return 0 ;
You can’t perform that action at this time.
0 commit comments