diff options
author | Simon Glass <sjg@chromium.org> | 2017-08-05 15:45:54 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-09-11 21:43:58 -0600 |
commit | 3991f42ed2e38aff28ba3c24369bfbd90620bea7 (patch) | |
tree | 4e91056bedde884d7bec42bf45a32e6a1fcd01e0 /arch | |
parent | 8639f69a61b47971dba47ab5ed72e47436729bb1 (diff) | |
download | u-boot-3991f42ed2e38aff28ba3c24369bfbd90620bea7.tar.gz |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/xusb-padctl-common.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/xusb-padctl-common.c b/arch/arm/mach-tegra/xusb-padctl-common.c index 37b5b8fb5b..abc18c03a5 100644 --- a/arch/arm/mach-tegra/xusb-padctl-common.c +++ b/arch/arm/mach-tegra/xusb-padctl-common.c @@ -224,9 +224,7 @@ tegra_xusb_padctl_config_parse_dt(struct tegra_xusb_padctl *padctl, config->name = ofnode_get_name(node); - for (subnode = ofnode_first_subnode(node); - ofnode_valid(subnode); - subnode = ofnode_next_subnode(subnode)) { + ofnode_for_each_subnode(subnode, node) { struct tegra_xusb_padctl_group *group; int err; @@ -256,9 +254,7 @@ static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl, return err; } - for (subnode = ofnode_first_subnode(node); - ofnode_valid(subnode); - subnode = ofnode_next_subnode(subnode)) { + ofnode_for_each_subnode(subnode, node) { struct tegra_xusb_padctl_config *config = &padctl->config; debug("%s: subnode=%s\n", __func__, ofnode_get_name(subnode)); |