aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/atmel_serial.c
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2013-10-17 11:37:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-17 16:30:14 -0400
commit892db58bd1285d44e6e1a1e36157161990ec5ae4 (patch)
treeb08ef2691b4ff1e0f265ae62e12ae5b490aab9d3 /drivers/tty/serial/atmel_serial.c
parent2c62a3c899805be7f054847d80210183e4a982d9 (diff)
tty/serial: at91: fix uart/usart selection for older products
Since commit 055560b04a8cd063aea916fd083b7aec02c2adb8 (serial: at91: distinguish usart and uart) the older products which do not have a name field in their register map are unable to use their serial output. As the main console output is usually the serial interface (aka DBGU) it is pretty unfortunate. So, instead of failing during probe() we just silently configure the serial peripheral as an uart. It allows us to use these serial outputs. The proper solution is proposed in another patch. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/atmel_serial.c')
-rw-r--r--drivers/tty/serial/atmel_serial.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index d067285a2d20..6b0f75eac8a2 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1499,7 +1499,7 @@ static void atmel_set_ops(struct uart_port *port)
1499/* 1499/*
1500 * Get ip name usart or uart 1500 * Get ip name usart or uart
1501 */ 1501 */
1502static int atmel_get_ip_name(struct uart_port *port) 1502static void atmel_get_ip_name(struct uart_port *port)
1503{ 1503{
1504 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 1504 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
1505 int name = UART_GET_IP_NAME(port); 1505 int name = UART_GET_IP_NAME(port);
@@ -1518,10 +1518,7 @@ static int atmel_get_ip_name(struct uart_port *port)
1518 atmel_port->is_usart = false; 1518 atmel_port->is_usart = false;
1519 } else { 1519 } else {
1520 dev_err(port->dev, "Not supported ip name, set to uart\n"); 1520 dev_err(port->dev, "Not supported ip name, set to uart\n");
1521 return -EINVAL;
1522 } 1521 }
1523
1524 return 0;
1525} 1522}
1526 1523
1527/* 1524/*
@@ -2405,9 +2402,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
2405 /* 2402 /*
2406 * Get port name of usart or uart 2403 * Get port name of usart or uart
2407 */ 2404 */
2408 ret = atmel_get_ip_name(&port->uart); 2405 atmel_get_ip_name(&port->uart);
2409 if (ret < 0)
2410 goto err_add_port;
2411 2406
2412 return 0; 2407 return 0;
2413 2408