diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-02-20 00:10:44 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-03-06 11:41:28 +0100 |
commit | 64c199dd29b7eed9def158afba2036fd2ebe905a (patch) | |
tree | 6a5d2ff97d2057f369157bdabe124874f4fdf6f8 /common | |
parent | ef317ef43d311c6769984e3f07d968abc4924b80 (diff) | |
download | barebox-64c199dd29b7eed9def158afba2036fd2ebe905a.tar.gz barebox-64c199dd29b7eed9def158afba2036fd2ebe905a.tar.xz |
of: Pass barebox internal format devicetree to of_get_fixed_tree
With this every devicetree is first converted to the barebox internal
format before it's converted back to dtb again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/oftree.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/common/oftree.c b/common/oftree.c index 555aa0b602..be9eb28b63 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -415,24 +415,23 @@ int of_fix_tree(struct fdt_header *fdt) * It increases the size of the tree and applies the registered * fixups. */ -struct fdt_header *of_get_fixed_tree(struct fdt_header *fdt) +struct fdt_header *of_get_fixed_tree(struct device_node *node) { int ret; void *fixfdt, *internalfdt = NULL; int size, align; + struct fdt_header *fdt; - if (!fdt) { - 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) + if (!node) { + node = of_get_root_node(); + if (!node) return NULL; } + fdt = internalfdt = of_flatten_dtb(node); + if (!fdt) + return NULL; + size = fdt_totalsize(fdt); /* |