mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
dmaengine: txx9dmac: 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>
This commit is contained in:
parent
a06a5bb908
commit
d254c8d0a7
1 changed files with 3 additions and 6 deletions
|
@ -403,16 +403,14 @@ static void
|
||||||
txx9dmac_descriptor_complete(struct txx9dmac_chan *dc,
|
txx9dmac_descriptor_complete(struct txx9dmac_chan *dc,
|
||||||
struct txx9dmac_desc *desc)
|
struct txx9dmac_desc *desc)
|
||||||
{
|
{
|
||||||
dma_async_tx_callback callback;
|
struct dmaengine_desc_callback cb;
|
||||||
void *param;
|
|
||||||
struct dma_async_tx_descriptor *txd = &desc->txd;
|
struct dma_async_tx_descriptor *txd = &desc->txd;
|
||||||
|
|
||||||
dev_vdbg(chan2dev(&dc->chan), "descriptor %u %p complete\n",
|
dev_vdbg(chan2dev(&dc->chan), "descriptor %u %p complete\n",
|
||||||
txd->cookie, desc);
|
txd->cookie, desc);
|
||||||
|
|
||||||
dma_cookie_complete(txd);
|
dma_cookie_complete(txd);
|
||||||
callback = txd->callback;
|
dmaengine_desc_get_callback(txd, &cb);
|
||||||
param = txd->callback_param;
|
|
||||||
|
|
||||||
txx9dmac_sync_desc_for_cpu(dc, desc);
|
txx9dmac_sync_desc_for_cpu(dc, desc);
|
||||||
list_splice_init(&desc->tx_list, &dc->free_list);
|
list_splice_init(&desc->tx_list, &dc->free_list);
|
||||||
|
@ -423,8 +421,7 @@ txx9dmac_descriptor_complete(struct txx9dmac_chan *dc,
|
||||||
* The API requires that no submissions are done from a
|
* The API requires that no submissions are done from a
|
||||||
* callback, so we don't need to drop the lock here
|
* callback, so we don't need to drop the lock here
|
||||||
*/
|
*/
|
||||||
if (callback)
|
dmaengine_desc_callback_invoke(&cb, NULL);
|
||||||
callback(param);
|
|
||||||
dma_run_dependencies(txd);
|
dma_run_dependencies(txd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue