diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fdtdec.c | 15 | ||||
-rw-r--r-- | lib/list_sort.c | 1 | ||||
-rw-r--r-- | lib/rbtree.c | 1 |
3 files changed, 15 insertions, 2 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) { /* diff --git a/lib/list_sort.c b/lib/list_sort.c index 81de0a17de..e841da53ee 100644 --- a/lib/list_sort.c +++ b/lib/list_sort.c @@ -1,4 +1,3 @@ -#define __UBOOT__ #ifndef __UBOOT__ #include <linux/kernel.h> #include <linux/module.h> diff --git a/lib/rbtree.c b/lib/rbtree.c index 9e52f70d17..5de3bf4026 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -9,7 +9,6 @@ linux/lib/rbtree.c */ -#define __UBOOT__ #include <linux/rbtree_augmented.h> #ifndef __UBOOT__ #include <linux/export.h> |