Commit 9c1e511cc6675f3e2102e4a69a5d6eda18cfacc1
Committed by
Vinod Koul
1 parent
7a883acd39
Exists in
smarc_imx_lf-5.15.y
and in
27 other branches
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>
Showing 1 changed file with 5 additions and 9 deletions Side-by-side Diff
drivers/dma/mmp_pdma.c
... | ... | @@ -864,19 +864,15 @@ |
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 | } |
... | ... | @@ -921,8 +917,8 @@ |
921 | 917 | /* Remove from the list of transactions */ |
922 | 918 | list_del(&desc->node); |
923 | 919 | /* Run the link descriptor callback function */ |
924 | - if (txd->callback) | |
925 | - txd->callback(txd->callback_param); | |
920 | + dmaengine_desc_get_callback(txd, &cb); | |
921 | + dmaengine_desc_callback_invoke(&cb, NULL); | |
926 | 922 | |
927 | 923 | dma_pool_free(chan->desc_pool, desc, txd->phys); |
928 | 924 | } |