serial_core: Commonalize crlf when working w/ a non open console port
[cascardo/linux.git] / drivers / tty / serial / serial_core.c
index 2cf5649..5dba976 100644 (file)
@@ -89,8 +89,7 @@ static void __uart_start(struct tty_struct *tty)
        struct uart_state *state = tty->driver_data;
        struct uart_port *port = state->uart_port;
 
-       if (!uart_circ_empty(&state->xmit) && state->xmit.buf &&
-           !tty->stopped && !tty->hw_stopped)
+       if (!tty->stopped && !tty->hw_stopped)
                port->ops->start_tx(port);
 }
 
@@ -1452,6 +1451,8 @@ static void uart_hangup(struct tty_struct *tty)
                clear_bit(ASYNCB_NORMAL_ACTIVE, &port->flags);
                spin_unlock_irqrestore(&port->lock, flags);
                tty_port_tty_set(port, NULL);
+               if (!uart_console(state->uart_port))
+                       uart_change_pm(state, UART_PM_STATE_OFF);
                wake_up_interruptible(&port->open_wait);
                wake_up_interruptible(&port->delta_msr_wait);
        }
@@ -2235,6 +2236,9 @@ static void uart_poll_put_char(struct tty_driver *driver, int line, char ch)
                return;
 
        port = state->uart_port;
+
+       if (ch == '\n')
+               port->ops->poll_put_char(port, '\r');
        port->ops->poll_put_char(port, ch);
 }
 #endif