diff options
Diffstat (limited to 'drivers/tty/serial/clps711x.c')
-rw-r--r-- | drivers/tty/serial/clps711x.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index 5e6fdb1ea73b..14aaea0d4131 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c | |||
@@ -368,16 +368,12 @@ static const struct uart_ops uart_clps711x_ops = { | |||
368 | static void uart_clps711x_console_putchar(struct uart_port *port, int ch) | 368 | static void uart_clps711x_console_putchar(struct uart_port *port, int ch) |
369 | { | 369 | { |
370 | struct clps711x_port *s = dev_get_drvdata(port->dev); | 370 | struct clps711x_port *s = dev_get_drvdata(port->dev); |
371 | u32 sysflg = 0; | ||
371 | 372 | ||
372 | /* Wait for FIFO is not full */ | 373 | /* Wait for FIFO is not full */ |
373 | while (1) { | 374 | do { |
374 | u32 sysflg = 0; | ||
375 | |||
376 | regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); | 375 | regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); |
377 | if (!(sysflg & SYSFLG_UTXFF)) | 376 | } while (sysflg & SYSFLG_UTXFF); |
378 | break; | ||
379 | cond_resched(); | ||
380 | } | ||
381 | 377 | ||
382 | writew(ch, port->membase + UARTDR_OFFSET); | 378 | writew(ch, port->membase + UARTDR_OFFSET); |
383 | } | 379 | } |
@@ -387,18 +383,14 @@ static void uart_clps711x_console_write(struct console *co, const char *c, | |||
387 | { | 383 | { |
388 | struct uart_port *port = clps711x_uart.state[co->index].uart_port; | 384 | struct uart_port *port = clps711x_uart.state[co->index].uart_port; |
389 | struct clps711x_port *s = dev_get_drvdata(port->dev); | 385 | struct clps711x_port *s = dev_get_drvdata(port->dev); |
386 | u32 sysflg = 0; | ||
390 | 387 | ||
391 | uart_console_write(port, c, n, uart_clps711x_console_putchar); | 388 | uart_console_write(port, c, n, uart_clps711x_console_putchar); |
392 | 389 | ||
393 | /* Wait for transmitter to become empty */ | 390 | /* Wait for transmitter to become empty */ |
394 | while (1) { | 391 | do { |
395 | u32 sysflg = 0; | ||
396 | |||
397 | regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); | 392 | regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); |
398 | if (!(sysflg & SYSFLG_UBUSY)) | 393 | } while (sysflg & SYSFLG_UBUSY); |
399 | break; | ||
400 | cond_resched(); | ||
401 | } | ||
402 | } | 394 | } |
403 | 395 | ||
404 | static int uart_clps711x_console_setup(struct console *co, char *options) | 396 | static int uart_clps711x_console_setup(struct console *co, char *options) |