Now, wait_for_xmitr() is only called from serial_putc(), and both are short enough. They can be merged into a single function.
Unified · Split
| @@ -73,24 +73,20 @@ static void __init serial8250_early_out(struct uart_port *port, int offset, int · 72 unmodified lines | |||
| 73 | 73 | ||
| 74 | #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) | 74 | #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) |
| 75 | 75 | ||
| 76 | static void __init wait_for_xmitr(struct uart_port *port) | 76 | static void __init serial_putc(struct uart_port *port, int c) |
| 77 | { | 77 | { |
| 78 | unsigned int status; | 78 | unsigned int status; |
| 79 | 79 | ||
| 80 | serial8250_early_out(port, UART_TX, c); | ||
| 81 | |||
| 80 | for (;;) { | 82 | for (;;) { |
| 81 | status = serial8250_early_in(port, UART_LSR); | 83 | status = serial8250_early_in(port, UART_LSR); |
| 82 | if ((status & BOTH_EMPTY) == BOTH_EMPTY) | 84 | if ((status & BOTH_EMPTY) == BOTH_EMPTY) |
| 83 | return; | 85 | break; |
| 84 | cpu_relax(); | 86 | cpu_relax(); |
| 85 | } | 87 | } |
| 86 | } | 88 | } |
| 87 | 89 | ||
| 88 | static void __init serial_putc(struct uart_port *port, int c) | ||
| 89 | { | ||
| 90 | serial8250_early_out(port, UART_TX, c); | ||
| 91 | wait_for_xmitr(port); | ||
| 92 | } | ||
| 93 | |||
| 94 | static void __init early_serial8250_write(struct console *console, | 90 | static void __init early_serial8250_write(struct console *console, |
| 95 | const char *s, unsigned int count) | 91 | const char *s, unsigned int count) |
| 96 | { | 92 | { |