summaryrefslogtreecommitdiffstats
path: root/lib/fdtdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fdtdec.c')
-rw-r--r--lib/fdtdec.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index c2f3645253..06d4542029 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -382,6 +382,21 @@ int fdtdec_get_alias_node(const void *blob, const char *name)
return fdt_path_offset(blob, prop);
}
+int fdtdec_get_chosen_node(const void *blob, const char *name)
+{
+ const char *prop;
+ int chosen_node;
+ int len;
+
+ if (!blob)
+ return -FDT_ERR_NOTFOUND;
+ chosen_node = fdt_path_offset(blob, "/chosen");
+ prop = fdt_getprop(blob, chosen_node, name, &len);
+ if (!prop)
+ return -FDT_ERR_NOTFOUND;
+ return fdt_path_offset(blob, prop);
+}
+
int fdtdec_check_fdt(void)
{
/*
OpenPOWER on IntegriCloud