summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/sh-sci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/sh-sci.c')
-rw-r--r--drivers/tty/serial/sh-sci.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index eb7958c675a8..920a6f929c8b 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -812,7 +812,7 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
}
/*
- * Here we define a transistion notifier so that we can update all of our
+ * Here we define a transition notifier so that we can update all of our
* ports' baud rate when the peripheral clock changes.
*/
static int sci_notifier(struct notifier_block *self,
@@ -1836,6 +1836,12 @@ static int __devinit serial_console_setup(struct console *co, char *options)
sci_port = &sci_ports[co->index];
port = &sci_port->port;
+ /*
+ * Refuse to handle uninitialized ports.
+ */
+ if (!port->ops)
+ return -ENODEV;
+
ret = sci_remap_port(port);
if (unlikely(ret != 0))
return ret;
@@ -1866,13 +1872,6 @@ static struct console serial_console = {
.data = &sci_uart_driver,
};
-static int __init sci_console_init(void)
-{
- register_console(&serial_console);
- return 0;
-}
-console_initcall(sci_console_init);
-
static struct console early_serial_console = {
.name = "early_ttySC",
.write = serial_console_write,
@@ -1901,18 +1900,18 @@ static int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
register_console(&early_serial_console);
return 0;
}
+
+#define SCI_CONSOLE (&serial_console)
+
#else
static inline int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
{
return -EINVAL;
}
-#endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */
-#if defined(CONFIG_SERIAL_SH_SCI_CONSOLE)
-#define SCI_CONSOLE (&serial_console)
-#else
-#define SCI_CONSOLE 0
-#endif
+#define SCI_CONSOLE NULL
+
+#endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */
static char banner[] __initdata =
KERN_INFO "SuperH SCI(F) driver initialized\n";