summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/oftree.c19
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);
/*