summaryrefslogtreecommitdiffstats
path: root/drivers/dma/ste_dma40.c
diff options
context:
space:
mode:
authorPeter Griffin <peter.griffin@linaro.org>2016-06-07 19:38:38 +0200
committerVinod Koul <vinod.koul@intel.com>2016-06-21 18:05:00 +0200
commita90e56e5b1779836132645e3352c7d5b60cddca8 (patch)
treea79be2baf6c5839d9f53ca6022260fc78e4e505e /drivers/dma/ste_dma40.c
parentdmaengine: s3c24xx: Simplify code in s3c24xx_dma_tx_status() (diff)
downloadlinux-a90e56e5b1779836132645e3352c7d5b60cddca8.tar.xz
linux-a90e56e5b1779836132645e3352c7d5b60cddca8.zip
dmaengine: ste_dma40: Only calculate residue if txstate exists.
There is no point calculating the residue if there is no txstate to store the value. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/ste_dma40.c')
-rw-r--r--drivers/dma/ste_dma40.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 6fb8307468ab..378cc47aa63a 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2588,7 +2588,7 @@ static enum dma_status d40_tx_status(struct dma_chan *chan,
}
ret = dma_cookie_status(chan, cookie, txstate);
- if (ret != DMA_COMPLETE)
+ if (ret != DMA_COMPLETE && txstate)
dma_set_residue(txstate, stedma40_residue(chan));
if (d40_is_paused(d40c))