if (data->rx_status == DMA_RX_SHUTDOWN)
                return;
 
-       spin_lock_irqsave(&up->port.lock, flags);
+       uart_port_lock_irqsave(&up->port, &flags);
 
        dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state);
        total = dma->rx_size - state.residue;
 
        mtk8250_rx_dma(up);
 
-       spin_unlock_irqrestore(&up->port.lock, flags);
+       uart_port_unlock_irqrestore(&up->port, flags);
 }
 
 static void mtk8250_rx_dma(struct uart_8250_port *up)
         * Ok, we're now changing the port state.  Do it with
         * interrupts disabled.
         */
-       spin_lock_irqsave(&port->lock, flags);
+       uart_port_lock_irqsave(port, &flags);
 
        /*
         * Update the per-port timeout.
        if (uart_console(port))
                up->port.cons->cflag = termios->c_cflag;
 
-       spin_unlock_irqrestore(&port->lock, flags);
+       uart_port_unlock_irqrestore(port, flags);
        /* Don't rewrite B0 */
        if (tty_termios_baud_rate(termios))
                tty_termios_encode_baud_rate(termios, baud, baud);