aboutsummaryrefslogtreecommitdiff
path: root/drivers/power/pmic
diff options
context:
space:
mode:
authorSimon Glass2017-08-05 15:45:54 -0600
committerSimon Glass2017-09-11 21:43:58 -0600
commit3991f42ed2e38aff28ba3c24369bfbd90620bea7 (patch)
tree4e91056bedde884d7bec42bf45a32e6a1fcd01e0 /drivers/power/pmic
parent8639f69a61b47971dba47ab5ed72e47436729bb1 (diff)
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 'drivers/power/pmic')
-rw-r--r--drivers/power/pmic/pmic-uclass.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/power/pmic/pmic-uclass.c b/drivers/power/pmic/pmic-uclass.c
index 953bbe50269..64964e4e963 100644
--- a/drivers/power/pmic/pmic-uclass.c
+++ b/drivers/power/pmic/pmic-uclass.c
@@ -34,9 +34,7 @@ int pmic_bind_children(struct udevice *pmic, ofnode parent,
debug("%s for '%s' at node offset: %d\n", __func__, pmic->name,
dev_of_offset(pmic));
- for (node = ofnode_first_subnode(parent);
- ofnode_valid(node);
- node = ofnode_next_subnode(node)) {
+ ofnode_for_each_subnode(node, parent) {
node_name = ofnode_get_name(node);
debug("* Found child node: '%s'\n", node_name);