aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/imx-dma.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2012-03-06 17:34:06 -0500
committerVinod Koul <vinod.koul@linux.intel.com>2012-03-13 02:06:06 -0400
commit4d4e58de32a192fea65ab84509d17d199bd291c8 (patch)
treebe35531778c9cc6bee73beb94d07e176a6f3599d /drivers/dma/imx-dma.c
parent08714f60b0fc6ea3a060b69b32e77139f14e6045 (diff)
dmaengine: move last completed cookie into generic dma_chan structure
Every DMA engine implementation declares a last completed dma cookie in their private dma channel structures. This is pointless, and forces driver specific code. Move this out into the common dma_chan structure. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Jassi Brar <jassisinghbrar@gmail.com> [imx-sdma.c & mxs-dma.c] Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/imx-dma.c')
-rw-r--r--drivers/dma/imx-dma.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 3296a7337f25..d3ddcba87f81 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -41,7 +41,6 @@ struct imxdma_channel {
41 struct dma_chan chan; 41 struct dma_chan chan;
42 spinlock_t lock; 42 spinlock_t lock;
43 struct dma_async_tx_descriptor desc; 43 struct dma_async_tx_descriptor desc;
44 dma_cookie_t last_completed;
45 enum dma_status status; 44 enum dma_status status;
46 int dma_request; 45 int dma_request;
47 struct scatterlist *sg_list; 46 struct scatterlist *sg_list;
@@ -65,7 +64,7 @@ static void imxdma_handle(struct imxdma_channel *imxdmac)
65{ 64{
66 if (imxdmac->desc.callback) 65 if (imxdmac->desc.callback)
67 imxdmac->desc.callback(imxdmac->desc.callback_param); 66 imxdmac->desc.callback(imxdmac->desc.callback_param);
68 imxdmac->last_completed = imxdmac->desc.cookie; 67 imxdmac->chan.completed_cookie = imxdmac->desc.cookie;
69} 68}
70 69
71static void imxdma_irq_handler(int channel, void *data) 70static void imxdma_irq_handler(int channel, void *data)
@@ -158,8 +157,8 @@ static enum dma_status imxdma_tx_status(struct dma_chan *chan,
158 157
159 last_used = chan->cookie; 158 last_used = chan->cookie;
160 159
161 ret = dma_async_is_complete(cookie, imxdmac->last_completed, last_used); 160 ret = dma_async_is_complete(cookie, chan->completed_cookie, last_used);
162 dma_set_tx_state(txstate, imxdmac->last_completed, last_used, 0); 161 dma_set_tx_state(txstate, chan->completed_cookie, last_used, 0);
163 162
164 return ret; 163 return ret;
165} 164}