summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-11-08 08:23:17 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-11-08 08:27:22 +0100
commit047ee22b894c15a01ed40f358d5c933b6807d880 (patch)
tree08e423335d66b7b935b6e0521ffa1a83732a0683 /arch/arm/lib
parentd0f1f07dfa2d9a31228856437dc2673f25f3dd66 (diff)
downloadbarebox-047ee22b894c15a01ed40f358d5c933b6807d880.tar.gz
barebox-047ee22b894c15a01ed40f358d5c933b6807d880.tar.xz
ARM: Fix appended device tree when CONFIG_OFTREE is enabled
When CONFIG_OFTREE is enabled the appended device tree is unflattened and put into data->of_root_node, but there it is never used again. To actually use the appended device tree put it into data->oftree instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/bootm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 9f3d950de6..9bd92f6181 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -266,12 +266,20 @@ static int do_bootz_linux_fdt(int fd, struct image_data *data)
}
if (IS_BUILTIN(CONFIG_OFTREE)) {
- data->of_root_node = of_unflatten_dtb(oftree);
- if (IS_ERR(data->of_root_node)) {
+ struct device_node *root;
+
+ root = of_unflatten_dtb(oftree);
+ if (IS_ERR(root)) {
pr_err("unable to unflatten devicetree\n");
+ goto err_free;
+ }
+ data->oftree = of_get_fixed_tree(root);
+ if (!data->oftree) {
+ pr_err("Unable to get fixed tree\n");
ret = -EINVAL;
goto err_free;
}
+
free(oftree);
} else {
data->oftree = oftree;