From: Mikko Ylinen Date: Mon, 7 Aug 2006 13:25:41 +0000 (+0300) Subject: ARM: OMAP: Check STI channel value before registering console driver X-Git-Tag: v2.6.18-omap1~118^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7245d8ee22276e6a0b4986c4900040c1f315facc;p=linux-2.6-omap-h63xx.git 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 --- 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");