Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: mmp_pdma: 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: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Dave Jiang and committed by
Vinod Koul
9c1e511c 7a883acd

+5 -9
+5 -9
drivers/dma/mmp_pdma.c
··· 864 864 struct mmp_pdma_desc_sw *desc, *_desc; 865 865 LIST_HEAD(chain_cleanup); 866 866 unsigned long flags; 867 + struct dmaengine_desc_callback cb; 867 868 868 869 if (chan->cyclic_first) { 869 - dma_async_tx_callback cb = NULL; 870 - void *cb_data = NULL; 871 - 872 870 spin_lock_irqsave(&chan->desc_lock, flags); 873 871 desc = chan->cyclic_first; 874 - cb = desc->async_tx.callback; 875 - cb_data = desc->async_tx.callback_param; 872 + dmaengine_desc_get_callback(&desc->async_tx, &cb); 876 873 spin_unlock_irqrestore(&chan->desc_lock, flags); 877 874 878 - if (cb) 879 - cb(cb_data); 875 + dmaengine_desc_callback_invoke(&cb, NULL); 880 876 881 877 return; 882 878 } ··· 917 921 /* Remove from the list of transactions */ 918 922 list_del(&desc->node); 919 923 /* Run the link descriptor callback function */ 920 - if (txd->callback) 921 - txd->callback(txd->callback_param); 924 + dmaengine_desc_get_callback(txd, &cb); 925 + dmaengine_desc_callback_invoke(&cb, NULL); 922 926 923 927 dma_pool_free(chan->desc_pool, desc, txd->phys); 924 928 }