dm: core: Add ofnode_get_chosen_prop()

Add a function to read a property from the chosen node, providing access
to its length. Update ofnode_get_chosen_string() to make use of it.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-01-27 08:49:46 -07:00
parent 1aada6313c
commit bd933bfd83
4 changed files with 29 additions and 3 deletions

View File

@@ -520,6 +520,18 @@ int ofnode_count_phandle_with_args(ofnode node, const char *list_name,
*/
ofnode ofnode_path(const char *path);
/**
* ofnode_read_chosen_prop() - get the value of a chosen property
*
* This looks for a property within the /chosen node and returns its value
*
* @propname: Property name to look for
* @sizep: Returns size of property, or FDT_ERR_... error code if function
* returns NULL
* @return property value if found, else NULL
*/
const void *ofnode_read_chosen_prop(const char *propname, int *sizep);
/**
* ofnode_read_chosen_string() - get the string value of a chosen property
*