diff options
author | Simon Glass <sjg@chromium.org> | 2018-06-11 13:07:13 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-07-09 09:11:00 -0600 |
commit | c60f671b65a8b336c3533fcf0f0ee45dff287ff7 (patch) | |
tree | a7c4b6ace5eccc2a9f79d3eac7171b3418741c58 /include/dm | |
parent | c98ad4434c1a680915d10e5696e6bee9c81044d5 (diff) | |
download | u-boot-c60f671b65a8b336c3533fcf0f0ee45dff287ff7.tar.gz |
dm: core: Add a way to find an ofnode by compatible string
Add an ofnode_by_compatible() to allow iterating through ofnodes with a
given compatible string.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r-- | include/dm/ofnode.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 61c42311f8..cd08a7e4d0 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -679,6 +679,17 @@ int ofnode_read_resource_byname(ofnode node, const char *name, struct resource *res); /** + * ofnode_by_compatible() - Find the next compatible node + * + * Find the next node after @from that is compatible with @compat + * + * @from: ofnode to start from (use ofnode_null() to start at the beginning) + * @compat: Compatible string to match + * @return ofnode found, or ofnode_null() if none + */ +ofnode ofnode_by_compatible(ofnode from, const char *compat); + +/** * ofnode_for_each_subnode() - iterate over all subnodes of a parent * * @node: child node (ofnode, lvalue) |