diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-08-21 20:02:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-04 17:33:48 +0100 |
commit | 3e14670c06968554c67b36d05e8c52c36c14671a (patch) | |
tree | 6c5882f0d84a4e5b8d8eecb58d0cee791f355490 /drivers/tty/serial/sh-sci.c | |
parent | 2e301474f15f00b3f2ccde85f6f19b17ec7ee70d (diff) |
serial: sh-sci: Use DMA submission helpers instead of open-coding
Replace open-coded
- calls to dma_async_tx_descriptor.tx_submit() by calls to the
dmaengine_submit() helper,
- dma_cookie_t comparisons by calls to dma_submit_error().
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/sh-sci.c')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 4345aa422eed..294b283f5c85 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1407,10 +1407,10 @@ static void sci_submit_rx(struct sci_port *s) s->desc_rx[i] = desc; desc->callback = sci_dma_rx_complete; desc->callback_param = s; - s->cookie_rx[i] = desc->tx_submit(desc); + s->cookie_rx[i] = dmaengine_submit(desc); } - if (!desc || s->cookie_rx[i] < 0) { + if (!desc || dma_submit_error(s->cookie_rx[i])) { if (i) { async_tx_ack(s->desc_rx[0]); s->cookie_rx[0] = -EINVAL; @@ -1476,8 +1476,8 @@ static void work_fn_rx(struct work_struct *work) return; } - s->cookie_rx[new] = desc->tx_submit(desc); - if (s->cookie_rx[new] < 0) { + s->cookie_rx[new] = dmaengine_submit(desc); + if (dma_submit_error(s->cookie_rx[new])) { dev_warn(port->dev, "Failed submitting Rx DMA descriptor\n"); sci_rx_dma_release(s, true); return; @@ -1530,8 +1530,8 @@ static void work_fn_tx(struct work_struct *work) desc->callback = sci_dma_tx_complete; desc->callback_param = s; spin_unlock_irq(&port->lock); - s->cookie_tx = desc->tx_submit(desc); - if (s->cookie_tx < 0) { + s->cookie_tx = dmaengine_submit(desc); + if (dma_submit_error(s->cookie_tx)) { dev_warn(port->dev, "Failed submitting Tx DMA descriptor\n"); /* switch to PIO */ sci_tx_dma_release(s, true); @@ -1562,7 +1562,7 @@ static void sci_start_tx(struct uart_port *port) } if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && - s->cookie_tx < 0) { + dma_submit_error(s->cookie_tx)) { s->cookie_tx = 0; schedule_work(&s->work_tx); } |