summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorPeter Griffin <peter.griffin@linaro.org>2016-06-07 17:38:39 (GMT)
committerVinod Koul <vinod.koul@intel.com>2016-06-21 16:05:00 (GMT)
commitb9ab9d10d9898cd022fece44a474e5ddb785d639 (patch)
treef8d19f77fe44b63fb13bb046250e30f0823a90c5 /drivers/dma
parenta90e56e5b1779836132645e3352c7d5b60cddca8 (diff)
downloadlinux-b9ab9d10d9898cd022fece44a474e5ddb785d639.tar.xz
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')
-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 5065ca4..3835fcd 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);