up->port.serial_out(&up->port, offset, value);
 }
 
+/**
+ *     serial_lsr_in - Read LSR register and preserve flags across reads
+ *     @up:    uart 8250 port
+ *
+ *     Read LSR register and handle saving non-preserved flags across reads.
+ *     The flags that are not preserved across reads are stored into
+ *     up->lsr_saved_flags.
+ *
+ *     Returns LSR value or'ed with the preserved flags (if any).
+ */
+static inline unsigned int serial_lsr_in(struct uart_8250_port *up)
+{
+       unsigned int lsr = up->lsr_saved_flags;
+
+       lsr |= serial_in(up, UART_LSR);
+       up->lsr_saved_flags = lsr & LSR_SAVE_FLAGS;
+
+       return lsr;
+}
+
 /*
  * For the 16C950
  */
 
         * the "Diva" UART used on the management processor on many HP
         * ia64 and parisc boxes.
         */
-       lsr = serial_in(up, UART_LSR);
-       up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
+       lsr = serial_lsr_in(up);
        if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) &&
            (!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) &&
            (lsr & UART_LSR_THRE)) {
 
        struct uart_8250_em485 *em485 = p->em485;
 
        if (em485) {
-               unsigned char lsr = serial_in(p, UART_LSR);
+               unsigned char lsr = serial_lsr_in(p);
                u64 stop_delay = 0;
 
-               p->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
-
                if (!(lsr & UART_LSR_THRE))
                        return;
                /*
 
        if (serial8250_set_THRI(up)) {
                if (up->bugs & UART_BUG_TXEN) {
-                       unsigned char lsr;
+                       unsigned char lsr = serial_lsr_in(up);
 
-                       lsr = serial_in(up, UART_LSR);
-                       up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
                        if (lsr & UART_LSR_THRE)
                                serial8250_tx_chars(up);
                }
        serial8250_rpm_get(up);
 
        spin_lock_irqsave(&port->lock, flags);
-       lsr = serial_port_in(port, UART_LSR);
-       up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
+       lsr = serial_lsr_in(up);
        spin_unlock_irqrestore(&port->lock, flags);
 
        serial8250_rpm_put(up);
 
        /* Wait up to 10ms for the character(s) to be sent. */
        for (;;) {
-               status = serial_in(up, UART_LSR);
-
-               up->lsr_saved_flags |= status & LSR_SAVE_FLAGS;
+               status = serial_lsr_in(up);
 
                if ((status & bits) == bits)
                        break;