diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 17:34:06 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-13 02:06:06 -0400 |
commit | 4d4e58de32a192fea65ab84509d17d199bd291c8 (patch) | |
tree | be35531778c9cc6bee73beb94d07e176a6f3599d /drivers/dma/mxs-dma.c | |
parent | 08714f60b0fc6ea3a060b69b32e77139f14e6045 (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/mxs-dma.c')
-rw-r--r-- | drivers/dma/mxs-dma.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index b06cd4ca626f..3696e6e4143a 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c | |||
@@ -111,7 +111,6 @@ struct mxs_dma_chan { | |||
111 | struct mxs_dma_ccw *ccw; | 111 | struct mxs_dma_ccw *ccw; |
112 | dma_addr_t ccw_phys; | 112 | dma_addr_t ccw_phys; |
113 | int desc_count; | 113 | int desc_count; |
114 | dma_cookie_t last_completed; | ||
115 | enum dma_status status; | 114 | enum dma_status status; |
116 | unsigned int flags; | 115 | unsigned int flags; |
117 | #define MXS_DMA_SG_LOOP (1 << 0) | 116 | #define MXS_DMA_SG_LOOP (1 << 0) |
@@ -274,7 +273,7 @@ static irqreturn_t mxs_dma_int_handler(int irq, void *dev_id) | |||
274 | stat1 &= ~(1 << channel); | 273 | stat1 &= ~(1 << channel); |
275 | 274 | ||
276 | if (mxs_chan->status == DMA_SUCCESS) | 275 | if (mxs_chan->status == DMA_SUCCESS) |
277 | mxs_chan->last_completed = mxs_chan->desc.cookie; | 276 | mxs_chan->chan.completed_cookie = mxs_chan->desc.cookie; |
278 | 277 | ||
279 | /* schedule tasklet on this channel */ | 278 | /* schedule tasklet on this channel */ |
280 | tasklet_schedule(&mxs_chan->tasklet); | 279 | tasklet_schedule(&mxs_chan->tasklet); |
@@ -538,7 +537,7 @@ static enum dma_status mxs_dma_tx_status(struct dma_chan *chan, | |||
538 | dma_cookie_t last_used; | 537 | dma_cookie_t last_used; |
539 | 538 | ||
540 | last_used = chan->cookie; | 539 | last_used = chan->cookie; |
541 | dma_set_tx_state(txstate, mxs_chan->last_completed, last_used, 0); | 540 | dma_set_tx_state(txstate, chan->completed_cookie, last_used, 0); |
542 | 541 | ||
543 | return mxs_chan->status; | 542 | return mxs_chan->status; |
544 | } | 543 | } |