aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/iop-adma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/iop-adma.c')
-rw-r--r--drivers/dma/iop-adma.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index 4496bc606662..ce45f3fb0343 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -61,17 +61,18 @@ static dma_cookie_t
61iop_adma_run_tx_complete_actions(struct iop_adma_desc_slot *desc, 61iop_adma_run_tx_complete_actions(struct iop_adma_desc_slot *desc,
62 struct iop_adma_chan *iop_chan, dma_cookie_t cookie) 62 struct iop_adma_chan *iop_chan, dma_cookie_t cookie)
63{ 63{
64 BUG_ON(desc->async_tx.cookie < 0); 64 struct dma_async_tx_descriptor *tx = &desc->async_tx;
65 if (desc->async_tx.cookie > 0) { 65
66 cookie = desc->async_tx.cookie; 66 BUG_ON(tx->cookie < 0);
67 desc->async_tx.cookie = 0; 67 if (tx->cookie > 0) {
68 cookie = tx->cookie;
69 tx->cookie = 0;
68 70
69 /* call the callback (must not sleep or submit new 71 /* call the callback (must not sleep or submit new
70 * operations to this channel) 72 * operations to this channel)
71 */ 73 */
72 if (desc->async_tx.callback) 74 if (tx->callback)
73 desc->async_tx.callback( 75 tx->callback(tx->callback_param);
74 desc->async_tx.callback_param);
75 76
76 /* unmap dma addresses 77 /* unmap dma addresses
77 * (unmap_single vs unmap_page?) 78 * (unmap_single vs unmap_page?)
@@ -81,7 +82,7 @@ iop_adma_run_tx_complete_actions(struct iop_adma_desc_slot *desc,
81 struct device *dev = 82 struct device *dev =
82 &iop_chan->device->pdev->dev; 83 &iop_chan->device->pdev->dev;
83 u32 len = unmap->unmap_len; 84 u32 len = unmap->unmap_len;
84 enum dma_ctrl_flags flags = desc->async_tx.flags; 85 enum dma_ctrl_flags flags = tx->flags;
85 u32 src_cnt; 86 u32 src_cnt;
86 dma_addr_t addr; 87 dma_addr_t addr;
87 dma_addr_t dest; 88 dma_addr_t dest;
@@ -115,7 +116,7 @@ iop_adma_run_tx_complete_actions(struct iop_adma_desc_slot *desc,
115 } 116 }
116 117
117 /* run dependent operations */ 118 /* run dependent operations */
118 dma_run_dependencies(&desc->async_tx); 119 dma_run_dependencies(tx);
119 120
120 return cookie; 121 return cookie;
121} 122}