mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
dm: core: Add ofnode_for_each_subnode()
Add a convenience macro to iterate over subnodes of a node. Make use of this where appropriate in the code. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -390,10 +390,11 @@ int ofnode_decode_display_timing(ofnode parent, int index,
|
||||
if (!ofnode_valid(timings))
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0, node = ofnode_first_subnode(timings);
|
||||
ofnode_valid(node) && i != index;
|
||||
node = ofnode_first_subnode(node))
|
||||
i++;
|
||||
i = 0;
|
||||
ofnode_for_each_subnode(node, timings) {
|
||||
if (i++ == index)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ofnode_valid(node))
|
||||
return -EINVAL;
|
||||
|
Reference in New Issue
Block a user