e4581cf353d15bfdd522e8c13f4ce18123f4f710
[openwrt.git] / target / linux / lantiq / patches-3.7 / 0001-MIPS-lantiq-unbreak-devicetree-init.patch
1 From a15d129a352e5f6ab821b81bc3f692ecc952a815 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Fri, 9 Nov 2012 12:09:57 +0100
4 Subject: [PATCH 1/6] MIPS: lantiq: unbreak devicetree init
5
6 The bootmem was incorrectly freed resulting in lots of dangling pointers.
7 Additionally we should use of_platform_populate() as the Documentaion tells us
8 to do so.
9
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 Patchwork: http://patchwork.linux-mips.org/patch/4518
12 ---
13  arch/mips/lantiq/prom.c |    5 +----
14  1 file changed, 1 insertion(+), 4 deletions(-)
15
16 --- a/arch/mips/lantiq/prom.c
17 +++ b/arch/mips/lantiq/prom.c
18 @@ -87,9 +87,6 @@ void __init device_tree_init(void)
19         reserve_bootmem(base, size, BOOTMEM_DEFAULT);
20  
21         unflatten_device_tree();
22 -
23 -       /* free the space reserved for the dt blob */
24 -       free_bootmem(base, size);
25  }
26  
27  void __init prom_init(void)
28 @@ -119,7 +116,7 @@ int __init plat_of_setup(void)
29                 sizeof(of_ids[0].compatible));
30         strncpy(of_ids[1].compatible, "simple-bus",
31                 sizeof(of_ids[1].compatible));
32 -       return of_platform_bus_probe(NULL, of_ids, NULL);
33 +       return of_platform_populate(NULL, of_ids, NULL, NULL);
34  }
35  
36  arch_initcall(plat_of_setup);