diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2018-08-20 11:09:58 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-09-18 08:12:21 -0600 |
commit | 61fba0faba432ae1cefc3984f863c28880d30329 (patch) | |
tree | e55b6dd9e140132a6ed6c913c14251df0ffcb21c /include/dm/of_access.h | |
parent | 427ddd84204cc0693e3f80f90f257b3d24b04307 (diff) | |
download | u-boot-61fba0faba432ae1cefc3984f863c28880d30329.tar.gz u-boot-61fba0faba432ae1cefc3984f863c28880d30329.tar.xz u-boot-61fba0faba432ae1cefc3984f863c28880d30329.zip |
ofnode: add ofnode_by_prop_value()
Adds ofnode_by_prop_value() to search for nodes with a given property
and value, an ofnode version of fdt_node_offset_by_prop_value().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/of_access.h')
-rw-r--r-- | include/dm/of_access.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/of_access.h b/include/dm/of_access.h index dd1abb8e97..5ed1a0cdb4 100644 --- a/include/dm/of_access.h +++ b/include/dm/of_access.h @@ -194,6 +194,22 @@ struct device_node *of_find_compatible_node(struct device_node *from, const char *type, const char *compatible); /** + * of_find_node_by_prop_value() - find a node with a given property value + * + * Find a node based on a property value. + * @from: Node to start searching from or NULL. the node you pass will not be + * searched, only the next one will; typically, you pass what the previous + * call returned. + * @propname: property name to check + * @propval: property value to search for + * @proplen: length of the value in propval + * @return node pointer or NULL if not found + */ +struct device_node *of_find_node_by_prop_value(struct device_node *from, + const char *propname, + const void *propval, + int proplen); +/** * of_find_node_by_phandle() - Find a node given a phandle * * @handle: phandle of the node to find |