mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
dmaengine: pl330: 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
5c066f7d01
commit
f08462c650
1 changed files with 4 additions and 6 deletions
|
@ -2039,14 +2039,12 @@ static void pl330_tasklet(unsigned long data)
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!list_empty(&pch->completed_list)) {
|
while (!list_empty(&pch->completed_list)) {
|
||||||
dma_async_tx_callback callback;
|
struct dmaengine_desc_callback cb;
|
||||||
void *callback_param;
|
|
||||||
|
|
||||||
desc = list_first_entry(&pch->completed_list,
|
desc = list_first_entry(&pch->completed_list,
|
||||||
struct dma_pl330_desc, node);
|
struct dma_pl330_desc, node);
|
||||||
|
|
||||||
callback = desc->txd.callback;
|
dmaengine_desc_get_callback(&desc->txd, &cb);
|
||||||
callback_param = desc->txd.callback_param;
|
|
||||||
|
|
||||||
if (pch->cyclic) {
|
if (pch->cyclic) {
|
||||||
desc->status = PREP;
|
desc->status = PREP;
|
||||||
|
@ -2064,9 +2062,9 @@ static void pl330_tasklet(unsigned long data)
|
||||||
|
|
||||||
dma_descriptor_unmap(&desc->txd);
|
dma_descriptor_unmap(&desc->txd);
|
||||||
|
|
||||||
if (callback) {
|
if (dmaengine_desc_callback_valid(&cb)) {
|
||||||
spin_unlock_irqrestore(&pch->lock, flags);
|
spin_unlock_irqrestore(&pch->lock, flags);
|
||||||
callback(callback_param);
|
dmaengine_desc_callback_invoke(&cb, NULL);
|
||||||
spin_lock_irqsave(&pch->lock, flags);
|
spin_lock_irqsave(&pch->lock, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue