arc: use unflatten_and_copy_device_tree
authorRob Herring <rob.herring@calxeda.com>
Mon, 26 Aug 2013 16:23:27 +0000 (11:23 -0500)
committerRob Herring <rob.herring@calxeda.com>
Wed, 9 Oct 2013 16:38:03 +0000 (11:38 -0500)
Use the common unflatten_and_copy_device_tree to copy the built-in FDT
out of init section.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
arch/arc/include/asm/mach_desc.h
arch/arc/kernel/devtree.c
arch/arc/kernel/setup.c

index 9998dc846ebb1b59944d32153e89e54e486c6423..d3e9c0a05be87134d62c07eec607104d70a73527 100644 (file)
@@ -82,6 +82,5 @@ __attribute__((__section__(".arch.info.init"))) = {   \
 };
 
 extern struct machine_desc *setup_machine_fdt(void *dt);
-extern void __init copy_devtree(void);
 
 #endif
index 2340af0e1d6f8c00b57b35a127bf73f673a244e2..eeb613aa44ffc78856e4f75039d533f69d10012e 100644 (file)
@@ -100,18 +100,3 @@ struct machine_desc * __init setup_machine_fdt(void *dt)
 
        return mdesc_best;
 }
-
-/*
- * Copy the flattened DT out of .init since unflattening doesn't copy strings
- * and the normal DT APIs refs them from orig flat DT
- */
-void __init copy_devtree(void)
-{
-       void *alloc = early_init_dt_alloc_memory_arch(
-                       be32_to_cpu(initial_boot_params->totalsize), 64);
-       if (alloc) {
-               memcpy(alloc, initial_boot_params,
-                               be32_to_cpu(initial_boot_params->totalsize));
-               initial_boot_params = alloc;
-       }
-}
index 2c68bc7e6a784132a97d3ad6b04d8535cf546deb..710bf895dc2c2f9148238a3eda6d390912d3cff5 100644 (file)
@@ -346,8 +346,7 @@ void __init setup_arch(char **cmdline_p)
        setup_arch_memory();
 
        /* copy flat DT out of .init and then unflatten it */
-       copy_devtree();
-       unflatten_device_tree();
+       unflatten_and_copy_device_tree();
 
        /* Can be issue if someone passes cmd line arg "ro"
         * But that is unlikely so keeping it as it is