Commit 7245d8ee authored by Mikko Ylinen's avatar Mikko Ylinen Committed by Juha Yrjola

ARM: OMAP: Check STI channel value before registering console driver

Since ab7ad9fe 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: default avatarMikko Ylinen <mikko.k.ylinen@nokia.com>
Signed-off-by: default avatarJuha Yrjola <juha.yrjola@solidboot.com>
parent 6b411907
......@@ -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");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment