]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Check STI channel value before registering console driver
authorMikko Ylinen <mikko.k.ylinen@nokia.com>
Mon, 7 Aug 2006 13:25:41 +0000 (16:25 +0300)
committerJuha Yrjola <juha.yrjola@solidboot.com>
Mon, 7 Aug 2006 13:25:41 +0000 (16:25 +0300)
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 <mikko.k.ylinen@nokia.com>
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
arch/arm/plat-omap/sti/sti-console.c

index 2a2554fbad612f846bf9223ad0f1acd076d465f7..451a139d46b90462575463773c1a8eac70df6bfb 100644 (file)
@@ -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");