powerpc: move epapr paravirt init of power_save to an initcall
authorStuart Yoder <stuart.yoder@freescale.com>
Wed, 30 Apr 2014 23:34:23 +0000 (18:34 -0500)
committerScott Wood <scottwood@freescale.com>
Thu, 22 May 2014 23:08:21 +0000 (18:08 -0500)
some restructuring of epapr paravirt init resulted in
ppc_md.power_save being set, and then overwritten to
NULL during machine_init.  This patch splits the
initialization of ppc_md.power_save out into a postcore
init call.

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
arch/powerpc/kernel/epapr_paravirt.c

index 7898be90f2dcd013ecec5d17dcb4897e9a1b62f7..8a7a62c85604f2066a1c5bb870e95c645da24606 100644 (file)
@@ -30,6 +30,7 @@ extern u32 epapr_ev_idle_start[];
 #endif
 
 bool epapr_paravirt_enabled;
+static bool epapr_has_idle;
 
 static int __init early_init_dt_scan_epapr(unsigned long node,
                                           const char *uname,
@@ -55,7 +56,7 @@ static int __init early_init_dt_scan_epapr(unsigned long node,
 
 #if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
        if (of_get_flat_dt_prop(node, "has-idle", NULL))
-               ppc_md.power_save = epapr_ev_idle;
+               epapr_has_idle = true;
 #endif
 
        epapr_paravirt_enabled = true;
@@ -70,3 +71,12 @@ int __init epapr_paravirt_early_init(void)
        return 0;
 }
 
+static int __init epapr_idle_init(void)
+{
+       if (epapr_has_idle)
+               ppc_md.power_save = epapr_ev_idle;
+
+       return 0;
+}
+
+postcore_initcall(epapr_idle_init);