aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/mv_xor.c
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2014-03-07 14:46:46 -0500
committerDan Williams <dan.j.williams@intel.com>2014-04-10 15:26:17 -0400
commite43147acba6f64ba32664dd0e590657cc49b6940 (patch)
treecb4bb53438968d1c55c0b0eb357659890ebf919b /drivers/dma/mv_xor.c
parent890766d278548afdc059cd977687c4f1297d72a0 (diff)
dma: mv_xor: Remove all callers of mv_xor_slot_cleanup()
In order to simplify the code, remove all the calls to the locked mv_xor_slot_cleanup() and instead use the unlocked version only, It's less error prone to have just one function, and require the caller to ensure proper locking. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/mv_xor.c')
-rw-r--r--drivers/dma/mv_xor.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index e2c8ec91155e..fad016a6dd84 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -379,7 +379,10 @@ mv_xor_slot_cleanup(struct mv_xor_chan *mv_chan)
379static void mv_xor_tasklet(unsigned long data) 379static void mv_xor_tasklet(unsigned long data)
380{ 380{
381 struct mv_xor_chan *chan = (struct mv_xor_chan *) data; 381 struct mv_xor_chan *chan = (struct mv_xor_chan *) data;
382 mv_xor_slot_cleanup(chan); 382
383 spin_lock_bh(&chan->lock);
384 __mv_xor_slot_cleanup(chan);
385 spin_unlock_bh(&chan->lock);
383} 386}
384 387
385static struct mv_xor_desc_slot * 388static struct mv_xor_desc_slot *
@@ -658,9 +661,10 @@ static void mv_xor_free_chan_resources(struct dma_chan *chan)
658 struct mv_xor_desc_slot *iter, *_iter; 661 struct mv_xor_desc_slot *iter, *_iter;
659 int in_use_descs = 0; 662 int in_use_descs = 0;
660 663
661 mv_xor_slot_cleanup(mv_chan);
662
663 spin_lock_bh(&mv_chan->lock); 664 spin_lock_bh(&mv_chan->lock);
665
666 __mv_xor_slot_cleanup(mv_chan);
667
664 list_for_each_entry_safe(iter, _iter, &mv_chan->chain, 668 list_for_each_entry_safe(iter, _iter, &mv_chan->chain,
665 chain_node) { 669 chain_node) {
666 in_use_descs++; 670 in_use_descs++;
@@ -704,7 +708,10 @@ static enum dma_status mv_xor_status(struct dma_chan *chan,
704 ret = dma_cookie_status(chan, cookie, txstate); 708 ret = dma_cookie_status(chan, cookie, txstate);
705 if (ret == DMA_COMPLETE) 709 if (ret == DMA_COMPLETE)
706 return ret; 710 return ret;
707 mv_xor_slot_cleanup(mv_chan); 711
712 spin_lock_bh(&mv_chan->lock);
713 __mv_xor_slot_cleanup(mv_chan);
714 spin_unlock_bh(&mv_chan->lock);
708 715
709 return dma_cookie_status(chan, cookie, txstate); 716 return dma_cookie_status(chan, cookie, txstate);
710} 717}