From 49a3fd50b24426b59a5811f0dd11c32e737ef245 Mon Sep 17 00:00:00 2001
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Date: Thu, 16 May 2013 17:52:25 +0100
Subject: [RFC] ARM: prima2: remove early and postcore initcalls.
This patch removes early_init and postcore_initcalls from the mach
layer to MACHINE callbacks.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
arch/arm/mach-prima2/common.c | 6 ++++++
arch/arm/mach-prima2/common.h | 1 +
arch/arm/mach-prima2/pm.c | 6 ++----
arch/arm/mach-prima2/pm.h | 2 ++
arch/arm/mach-prima2/rstc.c | 5 +----
5 files changed, 12 insertions(+), 8 deletions(-)
@@ -16,6 +16,7 @@
#include <linux/of.h>
#include <linux/of_platform.h>
#include "common.h"
+#include "pm.h"
static struct of_device_id sirfsoc_of_bus_ids[] __initdata = {
{ .compatible = "simple-bus", },
@@ -24,6 +25,8 @@ static struct of_device_id sirfsoc_of_bus_ids[] __initdata = {
void __init sirfsoc_mach_init(void)
{
+ sirfsoc_of_pwrc_init();
+ sirfsoc_memc_init();
of_platform_bus_probe(NULL, sirfsoc_of_bus_ids, NULL);
}
@@ -61,6 +64,7 @@ DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)")
.init_late = sirfsoc_init_late,
.dt_compat = atlas6_dt_match,
.restart = sirfsoc_restart,
+ .init_early = sirfsoc_of_rstc_init,
MACHINE_END
#endif
@@ -81,6 +85,7 @@ DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
.init_late = sirfsoc_init_late,
.dt_compat = prima2_dt_match,
.restart = sirfsoc_restart,
+ .init_early = sirfsoc_of_rstc_init,
MACHINE_END
#endif
@@ -100,5 +105,6 @@ DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)")
.init_late = sirfsoc_init_late,
.dt_compat = marco_dt_match,
.restart = sirfsoc_restart,
+ .init_early = sirfsoc_of_rstc_init,
MACHINE_END
#endif
@@ -20,6 +20,7 @@ extern struct smp_operations sirfsoc_smp_ops;
extern void sirfsoc_secondary_startup(void);
extern void sirfsoc_cpu_die(unsigned int cpu);
+extern void sirfsoc_of_rstc_init(void);
extern void __init sirfsoc_of_irq_init(void);
extern void __init sirfsoc_of_clk_init(void);
extern void sirfsoc_restart(char, const char *);
@@ -96,7 +96,7 @@ static const struct of_device_id pwrc_ids[] = {
{}
};
-static int __init sirfsoc_of_pwrc_init(void)
+int __init sirfsoc_of_pwrc_init(void)
{
struct device_node *np;
@@ -116,7 +116,6 @@ static int __init sirfsoc_of_pwrc_init(void)
return 0;
}
-postcore_initcall(sirfsoc_of_pwrc_init);
static const struct of_device_id memc_ids[] = {
{ .compatible = "sirf,prima2-memc" },
@@ -143,8 +142,7 @@ static struct platform_driver sirfsoc_memc_driver = {
},
};
-static int __init sirfsoc_memc_init(void)
+int __init sirfsoc_memc_init(void)
{
return platform_driver_register(&sirfsoc_memc_driver);
}
-postcore_initcall(sirfsoc_memc_init);
@@ -23,6 +23,8 @@
#ifndef __ASSEMBLY__
extern int sirfsoc_finish_suspend(unsigned long);
+extern int __init sirfsoc_of_pwrc_init(void);
+extern int __init sirfsoc_memc_init(void);
#endif
#endif
@@ -23,7 +23,7 @@ static struct of_device_id rstc_ids[] = {
{},
};
-static int __init sirfsoc_of_rstc_init(void)
+void sirfsoc_of_rstc_init(void)
{
struct device_node *np;
@@ -36,10 +36,7 @@ static int __init sirfsoc_of_rstc_init(void)
panic("unable to map rstc cpu registers\n");
of_node_put(np);
-
- return 0;
}
-early_initcall(sirfsoc_of_rstc_init);
int sirfsoc_reset_device(struct device *dev)
{
--
1.7.6.5