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/imx-sdma.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/imx-sdma.c')
-rw-r--r-- | drivers/dma/imx-sdma.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index bf736ad679ca..49aa4e876645 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
@@ -267,7 +267,6 @@ struct sdma_channel { | |||
267 | struct dma_chan chan; | 267 | struct dma_chan chan; |
268 | spinlock_t lock; | 268 | spinlock_t lock; |
269 | struct dma_async_tx_descriptor desc; | 269 | struct dma_async_tx_descriptor desc; |
270 | dma_cookie_t last_completed; | ||
271 | enum dma_status status; | 270 | enum dma_status status; |
272 | unsigned int chn_count; | 271 | unsigned int chn_count; |
273 | unsigned int chn_real_count; | 272 | unsigned int chn_real_count; |
@@ -529,7 +528,7 @@ static void mxc_sdma_handle_channel_normal(struct sdma_channel *sdmac) | |||
529 | else | 528 | else |
530 | sdmac->status = DMA_SUCCESS; | 529 | sdmac->status = DMA_SUCCESS; |
531 | 530 | ||
532 | sdmac->last_completed = sdmac->desc.cookie; | 531 | sdmac->chan.completed_cookie = sdmac->desc.cookie; |
533 | if (sdmac->desc.callback) | 532 | if (sdmac->desc.callback) |
534 | sdmac->desc.callback(sdmac->desc.callback_param); | 533 | sdmac->desc.callback(sdmac->desc.callback_param); |
535 | } | 534 | } |
@@ -1127,7 +1126,7 @@ static enum dma_status sdma_tx_status(struct dma_chan *chan, | |||
1127 | 1126 | ||
1128 | last_used = chan->cookie; | 1127 | last_used = chan->cookie; |
1129 | 1128 | ||
1130 | dma_set_tx_state(txstate, sdmac->last_completed, last_used, | 1129 | dma_set_tx_state(txstate, chan->completed_cookie, last_used, |
1131 | sdmac->chn_count - sdmac->chn_real_count); | 1130 | sdmac->chn_count - sdmac->chn_real_count); |
1132 | 1131 | ||
1133 | return sdmac->status; | 1132 | return sdmac->status; |