summaryrefslogtreecommitdiff
path: root/drivers/dma/sun6i-dma.c
diff options
context:
space:
mode:
authorPeter Griffin <peter.griffin@linaro.org>2016-06-07 18:38:39 +0100
committerVinod Koul <vinod.koul@intel.com>2016-06-21 21:35:00 +0530
commitb9ab9d10d9898cd022fece44a474e5ddb785d639 (patch)
treef8d19f77fe44b63fb13bb046250e30f0823a90c5 /drivers/dma/sun6i-dma.c
parenta90e56e5b1779836132645e3352c7d5b60cddca8 (diff)
dmaengine: sun6i-dma: Only calculate residue if state exists.
There is no point in calculating the residue if state does not exist to store the value. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/sun6i-dma.c')
-rw-r--r--drivers/dma/sun6i-dma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index 5065ca43face..3835fcde3545 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -865,7 +865,7 @@ static enum dma_status sun6i_dma_tx_status(struct dma_chan *chan,
size_t bytes = 0;
ret = dma_cookie_status(chan, cookie, state);
- if (ret == DMA_COMPLETE)
+ if (ret == DMA_COMPLETE || !state)
return ret;
spin_lock_irqsave(&vchan->vc.lock, flags);