sound: soc: tegra: Use tegra_dma_cancel() to abort request
Laxman Dewangan [Thu, 22 Mar 2012 10:04:52 +0000 (15:04 +0530)]
To terminate request from dma, use the tegra_dma_cancel() inplace of
tegra_dma_dequeue().
The api tegra_dma_dequeue() is getting to be obsolete.

Change-Id: Id2a888a726086fb1e4ade04ac047442554188bee
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/91754
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>

sound/soc/tegra/tegra_pcm.c

index 864aa4a..b42b5fb 100644 (file)
@@ -262,8 +262,11 @@ static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
                spin_lock_irqsave(&prtd->lock, flags);
                prtd->running = 0;
                spin_unlock_irqrestore(&prtd->lock, flags);
-               tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[0]);
-               tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[1]);
+               tegra_dma_cancel(prtd->dma_chan);
+               if (prtd->dma_req[0].status == -TEGRA_DMA_REQ_ERROR_ABORTED)
+                       prtd->dma_req[0].complete(&prtd->dma_req[0]);
+               if (prtd->dma_req[1].status == -TEGRA_DMA_REQ_ERROR_ABORTED)
+                       prtd->dma_req[1].complete(&prtd->dma_req[1]);
                break;
        default:
                return -EINVAL;