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)
committerMark Brown <broonie@linaro.org>
Thu, 24 Jul 2014 18:57:20 +0000 (19:57 +0100)
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>
(cherry picked from commit 2040b52768ebab6e7bd73af0dc63703269c62f17)
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/of/fdt.c

index b6e4d7fcd316fd0911305bf8c3cb48fbf28d3422..e521121ff71e00b3c0b9c54dc74f87462d9747f0 100644 (file)
@@ -559,6 +559,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();
 }