@@ -329,11 +329,11 @@ static dma_async_tx_callback __ld_cleanup(struct shdma_chan *schan, bool all)
/* Is the "exposed" head of a chain acked? */
bool head_acked = false;
dma_cookie_t cookie = 0;
- dma_async_tx_callback callback = NULL;
- void *param = NULL;
+ struct dmaengine_desc_callback cb;
unsigned long flags;
LIST_HEAD(cyclic_list);
+ cb.callback = NULL;
spin_lock_irqsave(&schan->chan_lock, flags);
list_for_each_entry_safe(desc, _desc, &schan->ld_queue, node) {
struct dma_async_tx_descriptor *tx = &desc->async_tx;
@@ -367,8 +367,7 @@ static dma_async_tx_callback __ld_cleanup(struct shdma_chan *schan, bool all)
/* Call callback on the last chunk */
if (desc->mark == DESC_COMPLETED && tx->callback) {
desc->mark = DESC_WAITING;
- callback = tx->callback;
- param = tx->callback_param;
+ dmaengine_desc_get_callback(tx, &cb);
dev_dbg(schan->dev, "descriptor #%d@%p on %d callback\n",
tx->cookie, tx, schan->id);
BUG_ON(desc->chunks != 1);
@@ -419,7 +418,7 @@ static dma_async_tx_callback __ld_cleanup(struct shdma_chan *schan, bool all)
}
}
- if (all && !callback)
+ if (all && !cb.callback)
/*
* Terminating and the loop completed normally: forgive
* uncompleted cookies
@@ -430,10 +429,9 @@ static dma_async_tx_callback __ld_cleanup(struct shdma_chan *schan, bool all)
spin_unlock_irqrestore(&schan->chan_lock, flags);
- if (callback)
- callback(param);
+ dmaengine_desc_callback_invoke(&cb, NULL);
- return callback;
+ return cb.callback;
}
/*
@@ -885,9 +883,11 @@ bool shdma_reset(struct shdma_dev *sdev)
/* Complete all */
list_for_each_entry(sdesc, &dl, node) {
struct dma_async_tx_descriptor *tx = &sdesc->async_tx;
+ struct dmaengine_desc_cb cb;
+
sdesc->mark = DESC_IDLE;
- if (tx->callback)
- tx->callback(tx->callback_param);
+ dmaengine_desc_get_callback(tx, &cb);
+ dmaengine_desc_callback_invoke(&cb, NULL);
}
spin_lock(&schan->chan_lock);
Convert driver to use the new helper function for callback Signed-off-by: Dave Jiang <dave.jiang@intel.com> --- drivers/dma/sh/shdma-base.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html