ARM: tegra: fuse: Use tegra_dma_cancel() to abort request
Laxman Dewangan [Wed, 18 Apr 2012 04:51:09 +0000 (09:51 +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: I4b886489458e4ec8f5eb43d857bf710fbb56f5ee
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/91751
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>

Conflicts:

arch/arm/mach-tegra/apbio.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

arch/arm/mach-tegra/apbio.c

index 9078b1d..8b83dcf 100644 (file)
@@ -71,6 +71,14 @@ static void apb_dma_complete(struct tegra_dma_req *req)
        complete(&tegra_apb_wait);
 }
 
+static void cancel_dma(struct tegra_dma_channel *dma_chan,
+               struct tegra_dma_req *req)
+{
+               tegra_dma_cancel(dma_chan);
+               if (req->status == -TEGRA_DMA_REQ_ERROR_ABORTED)
+                       req->complete(req);
+}
+
 u32 tegra_apb_readl(unsigned long offset)
 {
        struct tegra_dma_req req;
@@ -99,7 +107,7 @@ u32 tegra_apb_readl(unsigned long offset)
                msecs_to_jiffies(50));
 
        if (WARN(ret == 0, "apb read dma timed out")) {
-               tegra_dma_dequeue_req(tegra_apb_dma, &req);
+               cancel_dma(tegra_apb_dma, &req);
                *(u32 *)tegra_apb_bb = 0;
        }
 
@@ -138,7 +146,7 @@ void tegra_apb_writel(u32 value, unsigned long offset)
                msecs_to_jiffies(50));
 
        if (WARN(ret == 0, "apb write dma timed out"))
-               tegra_dma_dequeue_req(tegra_apb_dma, &req);
+               cancel_dma(tegra_apb_dma, &req);
 
        mutex_unlock(&tegra_apb_dma_lock);
 }