Commit 12381dc0 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Vinod Koul

dma: dw: return DMA_SUCCESS immediately from device_tx_status()

There is no point to go throught the rest of the function if first call to
dma_cookie_status() returned DMA_SUCCESS.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 3783cef8
...@@ -1098,12 +1098,12 @@ dwc_tx_status(struct dma_chan *chan, ...@@ -1098,12 +1098,12 @@ dwc_tx_status(struct dma_chan *chan,
enum dma_status ret; enum dma_status ret;
ret = dma_cookie_status(chan, cookie, txstate); ret = dma_cookie_status(chan, cookie, txstate);
if (ret != DMA_SUCCESS) { if (ret == DMA_SUCCESS)
dwc_scan_descriptors(to_dw_dma(chan->device), dwc); return ret;
ret = dma_cookie_status(chan, cookie, txstate); dwc_scan_descriptors(to_dw_dma(chan->device), dwc);
}
ret = dma_cookie_status(chan, cookie, txstate);
if (ret != DMA_SUCCESS) if (ret != DMA_SUCCESS)
dma_set_residue(txstate, dwc_get_residue(dwc)); dma_set_residue(txstate, dwc_get_residue(dwc));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment