From 49ebae2771c5af70d346f1c673174d75262d8cdc Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Fri, 8 Feb 2008 04:21:03 -0800 Subject: [PATCH] --- yaml --- r: 84763 b: refs/heads/master c: 1c0fd82f9375b41f880dc9d7fe32920f33dc945b h: refs/heads/master i: 84761: 90a78dd92c55b864b308d2fa418eba20c81de77f 84759: a671ca852c4931f8a9fd2b476ff706b03f29f3ca v: v3 --- [refs] | 2 +- trunk/drivers/serial/atmel_serial.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index cd358d689b1d..d5099bf282a0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 829dd8112274d46c5ed82d46be506762e2c8fcd8 +refs/heads/master: 1c0fd82f9375b41f880dc9d7fe32920f33dc945b diff --git a/trunk/drivers/serial/atmel_serial.c b/trunk/drivers/serial/atmel_serial.c index 4d1ccc2b762d..0b7b2743b996 100644 --- a/trunk/drivers/serial/atmel_serial.c +++ b/trunk/drivers/serial/atmel_serial.c @@ -834,13 +834,13 @@ static void __init atmel_console_get_options(struct uart_port *port, int *baud, { unsigned int mr, quot; -// TODO: CR is a write-only register -// unsigned int cr; -// -// cr = UART_GET_CR(port) & (ATMEL_US_RXEN | ATMEL_US_TXEN); -// if (cr == (ATMEL_US_RXEN | ATMEL_US_TXEN)) { -// /* ok, the port was enabled */ -// } + /* + * If the baud rate generator isn't running, the port wasn't + * initialized by the boot loader. + */ + quot = UART_GET_BRGR(port); + if (!quot) + return; mr = UART_GET_MR(port) & ATMEL_US_CHRL; if (mr == ATMEL_US_CHRL_8) @@ -860,7 +860,6 @@ static void __init atmel_console_get_options(struct uart_port *port, int *baud, * lower than one of those, as it would make us fall through * to a much lower baud rate than we really want. */ - quot = UART_GET_BRGR(port); *baud = port->uartclk / (16 * (quot - 1)); }