diff options
| author | Tom Rini <[email protected]> | 2021-11-28 20:38:01 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-11-28 20:38:13 -0500 |
| commit | c087b5ad974441d1408c028eb7087d86b6d127e9 (patch) | |
| tree | 1d5efba0d146dcd1a6a449963ea738cc6e4ff73e /include/dm/ofnode.h | |
| parent | 1943f2a2a7c58b76812fcad2d3012036af7464ce (diff) | |
| parent | 452e8c9086a9f95739582da5ccc2130e4bf1ae8b (diff) | |
Merge tag 'dm-pull-28nov21' of https://source.denx.de/u-boot/custodians/u-boot-dm into next
SPI flash documentation and tidy-ups
Various driver model enhancements
Fix up some missing unit tests with pytest
Diffstat (limited to 'include/dm/ofnode.h')
| -rw-r--r-- | include/dm/ofnode.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 0f680e5aa62..6601bd83189 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -590,11 +590,11 @@ int ofnode_stringlist_search(ofnode node, const char *propname, * * @node: node to check * @propname: name of the property containing the string list - * @index: index of the string to return + * @index: index of the string to return (cannot be negative) * @lenp: return location for the string length or an error code on failure * * @return: - * length of string, if found or -ve error value if not found + * 0 if found or -ve error value if not found */ int ofnode_read_string_index(ofnode node, const char *propname, int index, const char **outp); @@ -610,6 +610,26 @@ int ofnode_read_string_index(ofnode node, const char *propname, int index, int ofnode_read_string_count(ofnode node, const char *property); /** + * ofnode_read_string_list() - read a list of strings + * + * This produces a list of string pointers with each one pointing to a string + * in the string list. If the property does not exist, it returns {NULL}. + * + * The data is allocated and the caller is reponsible for freeing the return + * value (the list of string pointers). The strings themselves may not be + * changed as they point directly into the devicetree property. + * + * @node: node to check + * @listp: returns an allocated, NULL-terminated list of strings if the return + * value is > 0, else is set to NULL + * @return number of strings in list, 0 if none, -ENOMEM if out of memory, + * -EINVAL if no such property, -EENODATA if property is empty + * @return: NULL-terminated list of strings (NULL if no property or empty) + */ +int ofnode_read_string_list(ofnode node, const char *property, + const char ***listp); + +/** * ofnode_parse_phandle_with_args() - Find a node pointed by phandle in a list * * This function is useful to parse lists of phandles and their arguments. |
