aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-01-27 08:49:43 -0700
committerSimon Glass <sjg@chromium.org>2020-02-05 19:33:45 -0700
commit14ca9f7f5abf7b94d71cfd466fb339bf64f58bda (patch)
tree83895f7de742e7fd0c77cfa0374086f13cd1abda /include
parent74d594a20e035a2dfce232093774c50d986cb9ff (diff)
downloadu-boot-14ca9f7f5abf7b94d71cfd466fb339bf64f58bda.zip
u-boot-14ca9f7f5abf7b94d71cfd466fb339bf64f58bda.tar.gz
u-boot-14ca9f7f5abf7b94d71cfd466fb339bf64f58bda.tar.bz2
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 <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/dm/ofnode.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 62ba0c1..9e76ae8 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