aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2012-01-05 09:02:43 -0600
committerZiyann <jaraidaniel@gmail.com>2014-10-01 12:55:14 +0200
commit0ad395ac62e48fe234897e67b8abda84d1118b46 (patch)
tree981f36899639a4d5df486aea849387403daa9450
parent29e59ce6a21103b482dcac1eb974b5254f9a89fe (diff)
downloadkernel_samsung_tuna-0ad395ac62e48fe234897e67b8abda84d1118b46.zip
kernel_samsung_tuna-0ad395ac62e48fe234897e67b8abda84d1118b46.tar.gz
kernel_samsung_tuna-0ad395ac62e48fe234897e67b8abda84d1118b46.tar.bz2
OMAP: ramconsole: make omap_ram_console_register device_initcall
Commit: 65b0b50251c8aa66d5e1da712e3183c74b08c615 (ARM: OMAP: Fix ramconsole init) fixes the symptom of not having platform_device root device available at reserve. However, there is no need for omap_ram_console_register to be invoked by board files as we can do the registration internal to ram_console logic itself as part of device_initcall. We use a flag to ensure that we register the device only if the board file has updated relevant parameters. Change-Id: I1a0c622612007b0a0ce3249cf71a1dfed9401e24 Signed-off-by: Nishanth Menon <nm@ti.com>
-rw-r--r--arch/arm/mach-omap2/omap_ram_console.c18
-rw-r--r--arch/arm/mach-omap2/omap_ram_console.h6
2 files changed, 11 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/omap_ram_console.c b/arch/arm/mach-omap2/omap_ram_console.c
index e6ade19..b24f49a 100644
--- a/arch/arm/mach-omap2/omap_ram_console.c
+++ b/arch/arm/mach-omap2/omap_ram_console.c
@@ -42,18 +42,18 @@ static struct platform_device ram_console_device = {
},
};
+static __initdata bool omap_ramconsole_inited;
+
/**
- * omap_ram_console_register() - registers the ramconsole device
- *
- * Board files call this to register the ramconsole platform device.
- *
- * IMPORTANT: board files need to ensure that the DDR configurations
- * enable self refresh mode for this to function properly.
+ * omap_ram_console_register() - device_initcall to register ramconsole device
*/
-int omap_ram_console_register(void)
+static int __init omap_ram_console_register(void)
{
int ret;
+ if (!omap_ramconsole_inited)
+ return -ENODEV;
+
ret = platform_device_register(&ram_console_device);
if (ret) {
pr_err("%s: unable to register ram console device:"
@@ -67,6 +67,7 @@ int omap_ram_console_register(void)
return ret;
}
+device_initcall(omap_ram_console_register);
/**
* omap_ram_console_init() - setup the ram console device for OMAP
@@ -101,5 +102,8 @@ int __init omap_ram_console_init(phys_addr_t phy_addr, size_t size)
ram_console_resources[0].start = phy_addr;
ram_console_resources[0].end = phy_addr + size - 1;
+ /* flag for registration */
+ omap_ramconsole_inited = true;
+
return ret;
}
diff --git a/arch/arm/mach-omap2/omap_ram_console.h b/arch/arm/mach-omap2/omap_ram_console.h
index fb41799..edd75e8 100644
--- a/arch/arm/mach-omap2/omap_ram_console.h
+++ b/arch/arm/mach-omap2/omap_ram_console.h
@@ -23,17 +23,11 @@
#ifdef CONFIG_OMAP_RAM_CONSOLE
extern int omap_ram_console_init(phys_addr_t phy_addr, size_t size);
-extern int omap_ram_console_register(void);
#else
static inline int omap_ram_console_init(phys_addr_t phy_addr, size_t size)
{
return 0;
}
-
-static inline int omap_ram_console_register(void)
-{
- return 0;
-}
#endif /* CONFIG_OMAP_RAM_CONSOLE */
#endif