]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00329822-06 tty: serial: imx: use work_struct instead of delayed work
authorFugang Duan <b38611@freescale.com>
Fri, 5 Sep 2014 01:31:30 +0000 (09:31 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:18:19 +0000 (21:18 -0600)
For rx dma work, use work_struct instead of delayed work.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit bd468211cde377634e26fb1383b9c6e8c180fd27)

drivers/tty/serial/imx.c

index afcf0a598abe64c586e5d2fc4f10fd6c61a2a0b2..716639a2653bf64427d3f4c25fe043f71b0ef76c 100644 (file)
@@ -245,7 +245,7 @@ struct imx_port {
        unsigned int            tx_bytes;
        unsigned int            dma_tx_nents;
        struct delayed_work     tsk_dma_tx;
-       struct delayed_work     tsk_dma_rx;
+       struct work_struct      tsk_dma_rx;
        wait_queue_head_t       dma_wait;
        unsigned int            saved_reg[11];
 #define DMA_TX_IS_WORKING 1
@@ -915,8 +915,7 @@ static void dma_rx_push_data(struct imx_port *sport, struct tty_struct *tty,
 
 static void dma_rx_work(struct work_struct *w)
 {
-       struct delayed_work *delay_work = to_delayed_work(w);
-       struct imx_port *sport = container_of(delay_work, struct imx_port, tsk_dma_rx);
+       struct imx_port *sport = container_of(w, struct imx_port, tsk_dma_rx);
        struct tty_struct *tty = sport->port.state->port.tty;
 
        if (sport->rx_buf.last_completed_idx < sport->rx_buf.cur_idx) {
@@ -929,9 +928,6 @@ static void dma_rx_work(struct work_struct *w)
                                        IMX_RXBD_NUM);
                dma_rx_push_data(sport, tty, 0, sport->rx_buf.cur_idx + 1);
        }
-
-       if (!sport->dma_is_rxing)
-               start_rx_dma(sport);
 }
 
 static void imx_rx_dma_done(struct imx_port *sport)
@@ -980,7 +976,7 @@ static void dma_rx_callback(void *data)
                dev_err(sport->port.dev, "overwrite!\n");
 
        if (count)
-               schedule_delayed_work(&sport->tsk_dma_rx, 0);
+               schedule_work(&sport->tsk_dma_rx);
        else
                sport->rx_buf.last_completed_idx++;
 }
@@ -1223,7 +1219,7 @@ static int imx_startup(struct uart_port *port)
 
        if (sport->dma_is_inited) {
                INIT_DELAYED_WORK(&sport->tsk_dma_tx, dma_tx_work);
-               INIT_DELAYED_WORK(&sport->tsk_dma_rx, dma_rx_work);
+               INIT_WORK(&sport->tsk_dma_rx, dma_rx_work);
        }
 
        spin_lock_irqsave(&sport->port.lock, flags);
@@ -1556,7 +1552,7 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
 
        if (sport->dma_is_inited && !sport->dma_is_enabled) {
                imx_enable_dma(sport);
-               schedule_delayed_work(&sport->tsk_dma_rx, msecs_to_jiffies(1));
+               start_rx_dma(sport);
        }
 
        if (!sport->dma_is_enabled) {