aboutsummaryrefslogtreecommitdiff
path: root/drivers/core/ofnode.c
diff options
context:
space:
mode:
authorSimon Glass2020-01-27 08:49:46 -0700
committerSimon Glass2020-02-05 19:33:45 -0700
commitbd933bfd834364bca6cc6f3a62e4255090a5bec1 (patch)
treeaade4618c7168efe95a72e4466350513ce1549fd /drivers/core/ofnode.c
parent1aada6313ca9b9e9123a4118c78558ef413e1039 (diff)
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>
Diffstat (limited to 'drivers/core/ofnode.c')
-rw-r--r--drivers/core/ofnode.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 4fc29a7c432..f55ef15cee3 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -427,20 +427,25 @@ ofnode ofnode_path(const char *path)
return offset_to_ofnode(fdt_path_offset(gd->fdt_blob, path));
}
-const char *ofnode_read_chosen_string(const char *name)
+const void *ofnode_read_chosen_prop(const char *propname, int *sizep)
{
ofnode chosen_node;
chosen_node = ofnode_path("/chosen");
- return ofnode_read_string(chosen_node, name);
+ return ofnode_read_prop(chosen_node, propname, sizep);
+}
+
+const char *ofnode_read_chosen_string(const char *propname)
+{
+ return ofnode_read_chosen_prop(propname, NULL);
}
ofnode ofnode_get_chosen_node(const char *name)
{
const char *prop;
- prop = ofnode_read_chosen_string(name);
+ prop = ofnode_read_chosen_prop(name, NULL);
if (!prop)
return ofnode_null();