Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
[firefly-linux-kernel-4.4.55.git] / drivers / dma / at_hdmac.c
index bd5250e8c00c2b6e3aaf285c3e23dd9f158978c3..a0f3e6a06e06532b3701ade73b110d823eec591f 100644 (file)
@@ -69,7 +69,7 @@ static struct at_desc *atc_first_queued(struct at_dma_chan *atchan)
 }
 
 /**
- * atc_alloc_descriptor - allocate and return an initilized descriptor
+ * atc_alloc_descriptor - allocate and return an initialized descriptor
  * @chan: the channel to allocate descriptors for
  * @gfp_flags: GFP allocation flags
  *
@@ -790,12 +790,12 @@ static int atc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
        list_splice_init(&atchan->queue, &list);
        list_splice_init(&atchan->active_list, &list);
 
-       spin_unlock_bh(&atchan->lock);
-
        /* Flush all pending and queued descriptors */
        list_for_each_entry_safe(desc, _desc, &list, desc_node)
                atc_chain_complete(atchan, desc);
 
+       spin_unlock_bh(&atchan->lock);
+
        return 0;
 }