Commit 5ade6683 authored by Dave Jiang's avatar Dave Jiang Committed by Vinod Koul

dmaengine: qcom_hidma: convert callback to helper function

This is in preperation of moving to a callback that provides results to the
callback for the transaction. The conversion will maintain current behavior
and the driver must convert to new callback mechanism at a later time in
order to receive results.
Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
Reviewed-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarSinan Kaya <okaya@codeaurora.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 44967bf7
...@@ -132,8 +132,8 @@ static void hidma_process_completed(struct hidma_chan *mchan) ...@@ -132,8 +132,8 @@ static void hidma_process_completed(struct hidma_chan *mchan)
spin_unlock_irqrestore(&mchan->lock, irqflags); spin_unlock_irqrestore(&mchan->lock, irqflags);
llstat = hidma_ll_status(mdma->lldev, mdesc->tre_ch); llstat = hidma_ll_status(mdma->lldev, mdesc->tre_ch);
if (desc->callback && (llstat == DMA_COMPLETE)) if (llstat == DMA_COMPLETE)
desc->callback(desc->callback_param); dmaengine_desc_get_callback_invoke(desc, NULL);
last_cookie = desc->cookie; last_cookie = desc->cookie;
dma_run_dependencies(desc); dma_run_dependencies(desc);
...@@ -413,14 +413,9 @@ static int hidma_terminate_channel(struct dma_chan *chan) ...@@ -413,14 +413,9 @@ static int hidma_terminate_channel(struct dma_chan *chan)
/* return all user requests */ /* return all user requests */
list_for_each_entry_safe(mdesc, tmp, &list, node) { list_for_each_entry_safe(mdesc, tmp, &list, node) {
struct dma_async_tx_descriptor *txd = &mdesc->desc; struct dma_async_tx_descriptor *txd = &mdesc->desc;
dma_async_tx_callback callback = mdesc->desc.callback;
void *param = mdesc->desc.callback_param;
dma_descriptor_unmap(txd); dma_descriptor_unmap(txd);
dmaengine_desc_get_callback_invoke(txd, NULL);
if (callback)
callback(param);
dma_run_dependencies(txd); dma_run_dependencies(txd);
/* move myself to free_list */ /* move myself to free_list */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment