dma: dw: return DMA_SUCCESS immediately from device_tx_status()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 15 Jul 2013 12:04:40 +0000 (15:04 +0300)
committerVinod Koul <vinod.koul@intel.com>
Mon, 5 Aug 2013 04:02:26 +0000 (09:32 +0530)
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>
drivers/dma/dw/core.c

index 6932645..5f2ee5f 100644 (file)
@@ -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));