of: only scan for reserved mem when fdt present
authorJosh Cartwright <joshc@codeaurora.org>
Thu, 13 Mar 2014 21:36:36 +0000 (16:36 -0500)
committerGrant Likely <grant.likely@linaro.org>
Sat, 15 Mar 2014 12:38:22 +0000 (12:38 +0000)
When the reserved memory patches hit -next, several legacy (non-DT) boot
failures were detected and bisected down to that commit. There needs to
be some sanity checking whether a DT is even present before parsing the
reserved ranges.

Reported-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
drivers/of/fdt.c

index 510c0d8de8a0cbd5cd56af0431a08fc603d25f21..501bc83f8cdf60edbff4f0d958bdfbd7d85a60c3 100644 (file)
@@ -557,6 +557,9 @@ static int __init __fdt_scan_reserved_mem(unsigned long node, const char *uname,
  */
 void __init early_init_fdt_scan_reserved_mem(void)
 {
+       if (!initial_boot_params)
+               return;
+
        of_scan_flat_dt(__fdt_scan_reserved_mem, NULL);
        fdt_init_reserved_mem();
 }