summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-17 14:47:01 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-03-06 11:41:28 +0100
commit004cce1347e876b008c494ce440d5115d47e6cbe (patch)
treef912cffccd8ccf2311c28a3467fbb89e6bf5c4ab /common
parent1d9859d5e70fe5c5269ecf0d22ede270da57ac4f (diff)
downloadbarebox-004cce1347e876b008c494ce440d5115d47e6cbe.tar.gz
barebox-004cce1347e876b008c494ce440d5115d47e6cbe.tar.xz
of: make flatten independent of libfdt
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/oftree.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/oftree.c b/common/oftree.c
index 82e5ddd60b..555aa0b602 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -422,7 +422,13 @@ struct fdt_header *of_get_fixed_tree(struct fdt_header *fdt)
int size, align;
if (!fdt) {
- fdt = internalfdt = of_flatten_dtb();
+ struct device_node *root_node;
+
+ root_node = of_get_root_node();
+ if (!root_node)
+ return NULL;
+
+ fdt = internalfdt = of_flatten_dtb(root_node);
if (!fdt)
return NULL;
}