X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fof%2Ffdt.c;h=af824e7e03678b04520433180950858bb5ed2e35;hb=a7006c9747ef225ab070d96c054e85682a09a13e;hp=c787c3d95c600eb51955dcb4d2e64dca88d559ba;hpb=275220f0fcff1adf28a717076e00f575edf05fda;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index c787c3d95c60..c9db49c10f45 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -139,12 +139,13 @@ static void *unflatten_dt_alloc(unsigned long *mem, unsigned long size, /** * unflatten_dt_node - Alloc and populate a device_node from the flat tree * @blob: The parent device tree blob + * @mem: Memory chunk to use for allocating device nodes and properties * @p: pointer to node in flat tree * @dad: Parent struct device_node * @allnextpp: pointer to ->allnext from last allocated device_node * @fpsize: Size of the node path up at the current depth. */ -unsigned long unflatten_dt_node(struct boot_param_header *blob, +static unsigned long unflatten_dt_node(struct boot_param_header *blob, unsigned long mem, unsigned long *p, struct device_node *dad, @@ -230,6 +231,7 @@ unsigned long unflatten_dt_node(struct boot_param_header *blob, } kref_init(&np->kref); } + /* process properties */ while (1) { u32 sz, noff; char *pname; @@ -351,7 +353,7 @@ unsigned long unflatten_dt_node(struct boot_param_header *blob, * @dt_alloc: An allocator that provides a virtual address to memory * for the resulting tree */ -void __unflatten_device_tree(struct boot_param_header *blob, +static void __unflatten_device_tree(struct boot_param_header *blob, struct device_node **mynodes, void * (*dt_alloc)(u64 size, u64 align)) { @@ -692,12 +694,6 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, return 1; } -static void *__init early_device_tree_alloc(u64 size, u64 align) -{ - unsigned long mem = early_init_dt_alloc_memory_arch(size, align); - return __va(mem); -} - /** * unflatten_device_tree - create tree of device_nodes from flat blob * @@ -709,7 +705,7 @@ static void *__init early_device_tree_alloc(u64 size, u64 align) void __init unflatten_device_tree(void) { __unflatten_device_tree(initial_boot_params, &allnodes, - early_device_tree_alloc); + early_init_dt_alloc_memory_arch); /* Get pointer to OF "/chosen" node for use everywhere */ of_chosen = of_find_node_by_path("/chosen");