summaryrefslogtreecommitdiff
path: root/include/dm/ofnode.h
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2021-11-11 09:04:20 -0500
committerTom Rini <[email protected]>2021-11-11 09:04:20 -0500
commit1e72ad6b387c599f477f83cda67ab525c089a9b0 (patch)
treee9902c9fb94534a8c98d880db36a74a8ec17e173 /include/dm/ofnode.h
parent166a77b34b30f64f7b12a3016b0bba49d568c52e (diff)
parent99e1fa89f1a6ce13787af34cbd933c846bc7e93a (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
- device-tree sync-up with Linux for ls1028a - fixes/update in fsl-ddr driver, fsl-validate, lx2162a, fsl-mc, spintable code, configs, qspi node, pci - enable EFI_SET_TIME support in sl28 - powerpc: Drop -mstring
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r--include/dm/ofnode.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 6a714d0c7b5..0f680e5aa62 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -1010,6 +1010,30 @@ ofnode ofnode_by_prop_value(ofnode from, const char *propname,
node = ofnode_next_subnode(node))
/**
+ * ofnode_for_each_compatible_node() - iterate over all nodes with a given
+ * compatible string
+ *
+ * @node: child node (ofnode, lvalue)
+ * @compat: compatible string to match
+ *
+ * This is a wrapper around a for loop and is used like so:
+ *
+ * ofnode node;
+ *
+ * ofnode_for_each_compatible_node(node, parent, compatible) {
+ * Use node
+ * ...
+ * }
+ *
+ * Note that this is implemented as a macro and @node is used as
+ * iterator in the loop.
+ */
+#define ofnode_for_each_compatible_node(node, compat) \
+ for (node = ofnode_by_compatible(ofnode_null(), compat); \
+ ofnode_valid(node); \
+ node = ofnode_by_compatible(node, compat))
+
+/**
* ofnode_get_child_count() - get the child count of a ofnode
*
* @node: valid node to get its child count