aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-01-22 13:59:42 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-01-24 06:59:57 -0500
commitd28122a5877cc40350fa801353fd5a9350563ec3 (patch)
treee06ed644c3fe537f35dfd87e8acebffe7f1b8e4f /drivers/serial
parent7f215abc69302dc027f024fe656e4841063e8fe8 (diff)
[ARM] Fix AMBA serial drivers for non-first serial ports
Using console=ttyAM1 or console=ttyAMA1 resulted in an oops during boot due to trying to drive the console before that port had been registered. Fix this by checking whether the port is present before allowing console setup to proceed. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/amba-pl010.c2
-rw-r--r--drivers/serial/amba-pl011.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index 61db6973755a..f69bd097166e 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -589,6 +589,8 @@ static int __init pl010_console_setup(struct console *co, char *options)
589 */ 589 */
590 if (co->index >= UART_NR) 590 if (co->index >= UART_NR)
591 co->index = 0; 591 co->index = 0;
592 if (!amba_ports[co->index])
593 return -ENODEV;
592 port = &amba_ports[co->index]->port; 594 port = &amba_ports[co->index]->port;
593 595
594 if (options) 596 if (options)
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 9a3b374b2a08..44639e71372a 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -661,6 +661,8 @@ static int __init pl011_console_setup(struct console *co, char *options)
661 if (co->index >= UART_NR) 661 if (co->index >= UART_NR)
662 co->index = 0; 662 co->index = 0;
663 uap = amba_ports[co->index]; 663 uap = amba_ports[co->index];
664 if (!uap)
665 return -ENODEV;
664 666
665 uap->port.uartclk = clk_get_rate(uap->clk); 667 uap->port.uartclk = clk_get_rate(uap->clk);
666 668