From 14ca9f7f5abf7b94d71cfd466fb339bf64f58bda Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 27 Jan 2020 08:49:43 -0700 Subject: dm: core: Rename ofnode_get_chosen_prop() This function is actually intended to read a string rather than a property. All of its current callers use it that way. Also there is no way to return the length of the property from this function. Rename it to better indicate its purpose, using ofnode_read as the prefix since this matches most other functions. Also add some tests which are missing for these functions. Signed-off-by: Simon Glass --- include/dm/ofnode.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/dm/ofnode.h') diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 62ba0c13ea5..9e76ae8407f 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -510,14 +510,15 @@ int ofnode_count_phandle_with_args(ofnode node, const char *list_name, ofnode ofnode_path(const char *path); /** - * ofnode_get_chosen_prop() - get the value of a chosen property + * ofnode_read_chosen_string() - get the string value of a chosen property * - * This looks for a property within the /chosen node and returns its value + * This looks for a property within the /chosen node and returns its value, + * checking that it is a valid nul-terminated string * * @propname: Property name to look for - * @return property value if found, else NULL + * @return string value if found, else NULL */ -const char *ofnode_get_chosen_prop(const char *propname); +const char *ofnode_read_chosen_string(const char *propname); /** * ofnode_get_chosen_node() - get a referenced node from the chosen node -- cgit v1.2.3