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>
This commit is contained in:

committed by
Vinod Koul

parent
08714f60b0
commit
4d4e58de32
@@ -111,7 +111,6 @@ struct mxs_dma_chan {
|
||||
struct mxs_dma_ccw *ccw;
|
||||
dma_addr_t ccw_phys;
|
||||
int desc_count;
|
||||
dma_cookie_t last_completed;
|
||||
enum dma_status status;
|
||||
unsigned int flags;
|
||||
#define MXS_DMA_SG_LOOP (1 << 0)
|
||||
@@ -274,7 +273,7 @@ static irqreturn_t mxs_dma_int_handler(int irq, void *dev_id)
|
||||
stat1 &= ~(1 << channel);
|
||||
|
||||
if (mxs_chan->status == DMA_SUCCESS)
|
||||
mxs_chan->last_completed = mxs_chan->desc.cookie;
|
||||
mxs_chan->chan.completed_cookie = mxs_chan->desc.cookie;
|
||||
|
||||
/* schedule tasklet on this channel */
|
||||
tasklet_schedule(&mxs_chan->tasklet);
|
||||
@@ -538,7 +537,7 @@ static enum dma_status mxs_dma_tx_status(struct dma_chan *chan,
|
||||
dma_cookie_t last_used;
|
||||
|
||||
last_used = chan->cookie;
|
||||
dma_set_tx_state(txstate, mxs_chan->last_completed, last_used, 0);
|
||||
dma_set_tx_state(txstate, chan->completed_cookie, last_used, 0);
|
||||
|
||||
return mxs_chan->status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user