summaryrefslogtreecommitdiffstats
path: root/drivers/of/fdt.c
diff options
context:
space:
mode:
authorLaura Abbott <lauraa@codeaurora.org>2014-07-15 10:03:34 -0700
committerGrant Likely <grant.likely@linaro.org>2014-07-29 21:26:37 -0600
commit4972a74b888c6b52ca41fae6076786dbbeb746d5 (patch)
tree6240aa1e50e06cc007ac258420127b396e13d08b /drivers/of/fdt.c
parent64aa90f26c06e1cb2aacfb98a7d0eccfbd6c1a91 (diff)
downloadlinux-4972a74b888c6b52ca41fae6076786dbbeb746d5.tar.bz2
of: Split early_init_dt_scan into two parts
Currently, early_init_dt_scan validates the header, sets the boot params, and scans for chosen/memory all in one function. Split this up into two separate functions (validation/setting boot params in one, scanning in another) to allow for additional setup between boot params and scanning the memory. Signed-off-by: Laura Abbott <lauraa@codeaurora.org> Tested-by: Andreas Färber <afaerber@suse.de> [glikely: s/early_init_dt_scan_all/early_init_dt_scan_nodes/] Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r--drivers/of/fdt.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index b777d8f46bd5..ecc7a02d868e 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -937,7 +937,7 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
}
#endif
-bool __init early_init_dt_scan(void *params)
+bool __init early_init_dt_verify(void *params)
{
if (!params)
return false;
@@ -951,6 +951,12 @@ bool __init early_init_dt_scan(void *params)
return false;
}
+ return true;
+}
+
+
+void __init early_init_dt_scan_nodes(void)
+{
/* Retrieve various information from the /chosen node */
of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
@@ -959,7 +965,17 @@ bool __init early_init_dt_scan(void *params)
/* Setup memory, calling early_init_dt_add_memory_arch */
of_scan_flat_dt(early_init_dt_scan_memory, NULL);
+}
+
+bool __init early_init_dt_scan(void *params)
+{
+ bool status;
+
+ status = early_init_dt_verify(params);
+ if (!status)
+ return false;
+ early_init_dt_scan_nodes();
return true;
}