diff options
Diffstat (limited to 'drivers/serial/altera_uart.c')
-rw-r--r-- | drivers/serial/altera_uart.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/serial/altera_uart.c b/drivers/serial/altera_uart.c index b1609cca0ec4..7d6afc9755d5 100644 --- a/drivers/serial/altera_uart.c +++ b/drivers/serial/altera_uart.c | |||
@@ -391,31 +391,24 @@ int __init early_altera_uart_setup(struct altera_uart_platform_uart *platp) | |||
391 | return 0; | 391 | return 0; |
392 | } | 392 | } |
393 | 393 | ||
394 | static void altera_uart_console_putc(struct console *co, const char c) | 394 | static void altera_uart_console_putc(struct uart_port *port, const char c) |
395 | { | 395 | { |
396 | struct uart_port *port = &(altera_uart_ports + co->index)->port; | 396 | while (!(readl(port->membase + ALTERA_UART_STATUS_REG) & |
397 | int i; | 397 | ALTERA_UART_STATUS_TRDY_MSK)) |
398 | cpu_relax(); | ||
398 | 399 | ||
399 | for (i = 0; i < 0x10000; i++) { | ||
400 | if (readl(port->membase + ALTERA_UART_STATUS_REG) & | ||
401 | ALTERA_UART_STATUS_TRDY_MSK) | ||
402 | break; | ||
403 | } | ||
404 | writel(c, port->membase + ALTERA_UART_TXDATA_REG); | 400 | writel(c, port->membase + ALTERA_UART_TXDATA_REG); |
405 | for (i = 0; i < 0x10000; i++) { | ||
406 | if (readl(port->membase + ALTERA_UART_STATUS_REG) & | ||
407 | ALTERA_UART_STATUS_TRDY_MSK) | ||
408 | break; | ||
409 | } | ||
410 | } | 401 | } |
411 | 402 | ||
412 | static void altera_uart_console_write(struct console *co, const char *s, | 403 | static void altera_uart_console_write(struct console *co, const char *s, |
413 | unsigned int count) | 404 | unsigned int count) |
414 | { | 405 | { |
406 | struct uart_port *port = &(altera_uart_ports + co->index)->port; | ||
407 | |||
415 | for (; count; count--, s++) { | 408 | for (; count; count--, s++) { |
416 | altera_uart_console_putc(co, *s); | 409 | altera_uart_console_putc(port, *s); |
417 | if (*s == '\n') | 410 | if (*s == '\n') |
418 | altera_uart_console_putc(co, '\r'); | 411 | altera_uart_console_putc(port, '\r'); |
419 | } | 412 | } |
420 | } | 413 | } |
421 | 414 | ||