devicetree: Add DT_FOREACH_CHILD_STATUS_OKAY macro
The macro only iterates the enabled child nodes and invokes provided macro for each node. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
This commit is contained in:
parent
9681034875
commit
0700a24276
5 changed files with 41 additions and 0 deletions
|
@ -1485,6 +1485,21 @@
|
|||
#define DT_FOREACH_CHILD(node_id, fn) \
|
||||
DT_CAT(node_id, _FOREACH_CHILD)(fn)
|
||||
|
||||
/**
|
||||
* @brief Call "fn" on the child nodes with status "okay"
|
||||
*
|
||||
* The macro "fn" should take one argument, which is the node
|
||||
* identifier for the child node.
|
||||
*
|
||||
* As usual, both a missing status and an "ok" status are
|
||||
* treated as "okay".
|
||||
*
|
||||
* @param node_id node identifier
|
||||
* @param fn macro to invoke
|
||||
*/
|
||||
#define DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn) \
|
||||
DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY)(fn)
|
||||
|
||||
/**
|
||||
* @brief Invokes "fn" for each element in the value of property "prop".
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue