aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorThomas Abraham <thomas.ab@samsung.com>2011-06-14 06:12:26 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-07-06 20:10:21 -0400
commitee430f16251de889ddf8e303970713d9fba9a3f5 (patch)
tree9edac4feded77be8eccc5f8304aca8d1f1eae924 /drivers/tty
parent2c53b436a30867eb6b47dd7bab23ba638d1fb0d2 (diff)
serial: samsung: Fix unintended usage of uart port 0 as console
In s3c24xx_serial_console_setup function, if the uart port that is being setup as a console has not been initialized, an error can be returned instead of using uart port 0 as the default console port. The uart port that was intended to be used as a console could be initialized at a later point during boot and then registered as a console. This will avoid using uart port 0 as a unintended console port. Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/samsung.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index f66f64829303..014c1c3923e8 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1416,10 +1416,8 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
1416 1416
1417 /* is the port configured? */ 1417 /* is the port configured? */
1418 1418
1419 if (port->mapbase == 0x0) { 1419 if (port->mapbase == 0x0)
1420 co->index = 0; 1420 return -ENODEV;
1421 port = &s3c24xx_serial_ports[co->index].port;
1422 }
1423 1421
1424 cons_uart = port; 1422 cons_uart = port;
1425 1423