diff options
| author | Dave Jiang <dave.jiang@intel.com> | 2016-07-20 16:11:45 -0400 |
|---|---|---|
| committer | Vinod Koul <vinod.koul@intel.com> | 2016-08-07 22:41:39 -0400 |
| commit | 80a7d64325e79b811dd26254785323ccb1337fd5 (patch) | |
| tree | f7c6ebf4e05c473c201cfc420eb4fd850a01a0db /drivers/dma/ipu | |
| parent | db89e3c87715164abd7e2185a162499da1cdaa55 (diff) | |
dmaengine: ipu: 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>
Diffstat (limited to 'drivers/dma/ipu')
| -rw-r--r-- | drivers/dma/ipu/ipu_idmac.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c index b54f62de9232..ed76044ce4b9 100644 --- a/drivers/dma/ipu/ipu_idmac.c +++ b/drivers/dma/ipu/ipu_idmac.c | |||
| @@ -1160,11 +1160,10 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id) | |||
| 1160 | struct scatterlist **sg, *sgnext, *sgnew = NULL; | 1160 | struct scatterlist **sg, *sgnext, *sgnew = NULL; |
| 1161 | /* Next transfer descriptor */ | 1161 | /* Next transfer descriptor */ |
| 1162 | struct idmac_tx_desc *desc, *descnew; | 1162 | struct idmac_tx_desc *desc, *descnew; |
| 1163 | dma_async_tx_callback callback; | ||
| 1164 | void *callback_param; | ||
| 1165 | bool done = false; | 1163 | bool done = false; |
| 1166 | u32 ready0, ready1, curbuf, err; | 1164 | u32 ready0, ready1, curbuf, err; |
| 1167 | unsigned long flags; | 1165 | unsigned long flags; |
| 1166 | struct dmaengine_desc_callback cb; | ||
| 1168 | 1167 | ||
| 1169 | /* IDMAC has cleared the respective BUFx_RDY bit, we manage the buffer */ | 1168 | /* IDMAC has cleared the respective BUFx_RDY bit, we manage the buffer */ |
| 1170 | 1169 | ||
| @@ -1278,12 +1277,12 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id) | |||
| 1278 | 1277 | ||
| 1279 | if (likely(sgnew) && | 1278 | if (likely(sgnew) && |
| 1280 | ipu_submit_buffer(ichan, descnew, sgnew, ichan->active_buffer) < 0) { | 1279 | ipu_submit_buffer(ichan, descnew, sgnew, ichan->active_buffer) < 0) { |
| 1281 | callback = descnew->txd.callback; | 1280 | dmaengine_desc_get_callback(&descnew->txd, &cb); |
| 1282 | callback_param = descnew->txd.callback_param; | 1281 | |
| 1283 | list_del_init(&descnew->list); | 1282 | list_del_init(&descnew->list); |
| 1284 | spin_unlock(&ichan->lock); | 1283 | spin_unlock(&ichan->lock); |
| 1285 | if (callback) | 1284 | |
| 1286 | callback(callback_param); | 1285 | dmaengine_desc_callback_invoke(&cb, NULL); |
| 1287 | spin_lock(&ichan->lock); | 1286 | spin_lock(&ichan->lock); |
| 1288 | } | 1287 | } |
| 1289 | 1288 | ||
| @@ -1292,13 +1291,12 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id) | |||
| 1292 | if (done) | 1291 | if (done) |
| 1293 | dma_cookie_complete(&desc->txd); | 1292 | dma_cookie_complete(&desc->txd); |
| 1294 | 1293 | ||
| 1295 | callback = desc->txd.callback; | 1294 | dmaengine_desc_get_callback(&desc->txd, &cb); |
| 1296 | callback_param = desc->txd.callback_param; | ||
| 1297 | 1295 | ||
| 1298 | spin_unlock(&ichan->lock); | 1296 | spin_unlock(&ichan->lock); |
| 1299 | 1297 | ||
| 1300 | if (done && (desc->txd.flags & DMA_PREP_INTERRUPT) && callback) | 1298 | if (done && (desc->txd.flags & DMA_PREP_INTERRUPT)) |
| 1301 | callback(callback_param); | 1299 | dmaengine_desc_callback_invoke(&cb, NULL); |
| 1302 | 1300 | ||
| 1303 | return IRQ_HANDLED; | 1301 | return IRQ_HANDLED; |
| 1304 | } | 1302 | } |
