From 7245d8ee22276e6a0b4986c4900040c1f315facc Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Mon, 7 Aug 2006 16:25:41 +0300 Subject: [PATCH] ARM: OMAP: Check STI channel value before registering console driver Since ab7ad9fe425f03c9f83379509c44f98d155e1424 sti-console puts crap into STI if serial console is configured as a preferred console. This is due to uninitialized sti_console_channel (0 is a bad channel value). The fix is to check the STI channel value before registering the console driver. Signed-off-by: Mikko Ylinen Signed-off-by: Juha Yrjola --- arch/arm/plat-omap/sti/sti-console.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-omap/sti/sti-console.c b/arch/arm/plat-omap/sti/sti-console.c index 2a2554fbad6..451a139d46b 100644 --- a/arch/arm/plat-omap/sti/sti-console.c +++ b/arch/arm/plat-omap/sti/sti-console.c @@ -21,7 +21,7 @@ static struct tty_driver *tty_driver; static DEFINE_SPINLOCK(sti_console_lock); -static unsigned int sti_console_channel; +static unsigned int sti_console_channel = -1; static int sti_line_done = -1; /* @@ -143,7 +143,11 @@ static int __init sti_console_init(void) sti_console_channel = info->channel; } + if (unlikely(sti_console_channel == -1)) + return -EINVAL; + register_console(&sti_console); + return 0; } __initcall(sti_console_init); @@ -179,7 +183,7 @@ static int __init sti_tty_init(void) late_initcall(sti_tty_init); module_param(sti_console_channel, uint, 0); -MODULE_PARM_DESC(sti_console_channel, "STI console channel (default 32)"); +MODULE_PARM_DESC(sti_console_channel, "STI console channel"); MODULE_AUTHOR("Paul Mundt"); MODULE_DESCRIPTION("OMAP STI console support"); MODULE_LICENSE("GPL"); -- 2.41.1