aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-sh-msiof.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2014-08-07 08:07:42 -0400
committerMark Brown <broonie@linaro.org>2014-08-16 18:14:30 -0400
commita5e7c719fe257214aeda3dadb502a4cf58209a61 (patch)
treed057d3f23c235bab199b4ec9010d79faf6336403 /drivers/spi/spi-sh-msiof.c
parenta6be4de6a24cbef6209e3a0fcddaee9e312a1f63 (diff)
spi: sh-msiof: Return early in sh_msiof_dma_once() where possible
Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-sh-msiof.c')
-rw-r--r--drivers/spi/spi-sh-msiof.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 811a42dba92a..daaa868e959f 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -642,18 +642,14 @@ static int sh_msiof_dma_once(struct sh_msiof_spi_priv *p, const void *tx,
642 desc_rx = dmaengine_prep_slave_single(p->master->dma_rx, 642 desc_rx = dmaengine_prep_slave_single(p->master->dma_rx,
643 p->rx_dma_addr, len, DMA_FROM_DEVICE, 643 p->rx_dma_addr, len, DMA_FROM_DEVICE,
644 DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 644 DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
645 if (!desc_rx) { 645 if (!desc_rx)
646 ret = -EAGAIN; 646 return -EAGAIN;
647 goto no_dma_rx;
648 }
649 647
650 desc_rx->callback = sh_msiof_dma_complete; 648 desc_rx->callback = sh_msiof_dma_complete;
651 desc_rx->callback_param = p; 649 desc_rx->callback_param = p;
652 cookie = dmaengine_submit(desc_rx); 650 cookie = dmaengine_submit(desc_rx);
653 if (dma_submit_error(cookie)) { 651 if (dma_submit_error(cookie))
654 ret = cookie; 652 return cookie;
655 goto no_dma_rx;
656 }
657 } 653 }
658 654
659 if (tx) { 655 if (tx) {
@@ -738,7 +734,6 @@ no_dma_tx:
738 if (rx) 734 if (rx)
739 dmaengine_terminate_all(p->master->dma_rx); 735 dmaengine_terminate_all(p->master->dma_rx);
740 sh_msiof_write(p, IER, 0); 736 sh_msiof_write(p, IER, 0);
741no_dma_rx:
742 return ret; 737 return ret;
743} 738}
744 739