aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-01-27 08:49:44 -0700
committerSimon Glass <sjg@chromium.org>2020-02-05 19:33:45 -0700
commita8167d8ee2305f688d970f7ea4c38d7ca9b205ca (patch)
tree758aba45e1a725e5933aa5f9684413bf70f57e40 /include
parent14ca9f7f5abf7b94d71cfd466fb339bf64f58bda (diff)
downloadu-boot-a8167d8ee2305f688d970f7ea4c38d7ca9b205ca.zip
u-boot-a8167d8ee2305f688d970f7ea4c38d7ca9b205ca.tar.gz
u-boot-a8167d8ee2305f688d970f7ea4c38d7ca9b205ca.tar.bz2
dm: core: Add ofnode_read_prop()
Add a new function to read a property that supports reading the length as well. Reimplement ofnode_read_string() using it and fix its comment. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/dm/ofnode.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 9e76ae8..8007483 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -257,9 +257,20 @@ int ofnode_read_u64(ofnode node, const char *propname, u64 *outp);
u64 ofnode_read_u64_default(ofnode node, const char *propname, u64 def);
/**
+ * ofnode_read_prop() - Read a property from a node
+ *
+ * @node: valid node reference to read property from
+ * @propname: name of the property to read
+ * @sizep: if non-NULL, returns the size of the property, or an error code
+ if not found
+ * @return property value, or NULL if there is no such property
+ */
+const void *ofnode_read_prop(ofnode node, const char *propname, int *sizep);
+
+/**
* ofnode_read_string() - Read a string from a property
*
- * @ref: valid node reference to read property from
+ * @node: valid node reference to read property from
* @propname: name of the property to read
* @return string from property value, or NULL if there is no such property
*/