diff options
-rw-r--r-- | arch/arm/mach-omap2/omap_ram_console.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_ram_console.h | 6 |
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 |