浏览代码

dmaengine: tegra20-apb-dma: 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>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Peter Griffin 9 年之前
父节点
当前提交
71f7e6cc55
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/dma/tegra20-apb-dma.c

+ 1 - 1
drivers/dma/tegra20-apb-dma.c

@@ -814,7 +814,7 @@ static enum dma_status tegra_dma_tx_status(struct dma_chan *dc,
 	unsigned int residual;
 	unsigned int residual;
 
 
 	ret = dma_cookie_status(dc, cookie, txstate);
 	ret = dma_cookie_status(dc, cookie, txstate);
-	if (ret == DMA_COMPLETE)
+	if (ret == DMA_COMPLETE || !txstate)
 		return ret;
 		return ret;
 
 
 	spin_lock_irqsave(&tdc->lock, flags);
 	spin_lock_irqsave(&tdc->lock, flags);