summaryrefslogtreecommitdiffstats
path: root/drivers/dma/dw/core.c
diff options
context:
space:
mode:
authorAndy Shevchenko2013-07-15 14:04:40 +0200
committerVinod Koul2013-08-05 06:02:26 +0200
commit12381dc0c764ecd1703adc6d23c869006223dab8 (patch)
treeb65a2fce43f6abb948dee0bdb606b18ecaa9297d /drivers/dma/dw/core.c
parentdma: dw: allow shared interrupts (diff)
downloadkernel-qcow2-linux-12381dc0c764ecd1703adc6d23c869006223dab8.tar.gz
kernel-qcow2-linux-12381dc0c764ecd1703adc6d23c869006223dab8.tar.xz
kernel-qcow2-linux-12381dc0c764ecd1703adc6d23c869006223dab8.zip
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dw/core.c')
-rw-r--r--drivers/dma/dw/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 6932645ca1f8..5f2ee5ff8fa4 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1098,12 +1098,12 @@ dwc_tx_status(struct dma_chan *chan,
enum dma_status ret;
ret = dma_cookie_status(chan, cookie, txstate);
- if (ret != DMA_SUCCESS) {
- dwc_scan_descriptors(to_dw_dma(chan->device), dwc);
+ if (ret == DMA_SUCCESS)
+ 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)
dma_set_residue(txstate, dwc_get_residue(dwc));