]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00292129 PXP: remove some unnecessary code from PXP dma driver
authorFancy Fang <B47543@freescale.com>
Mon, 16 Dec 2013 05:34:25 +0000 (13:34 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 16 Jun 2014 16:09:14 +0000 (18:09 +0200)
There is no need to use spin lock in pxp_prep_slave_sg() after
dynamic descriptors allocation enabled.

Signed-off-by: Fancy Fang <B47543@freescale.com>
drivers/dma/pxp/pxp_dma_v2.c

index 4cbcde5960050408ac85e5453dc8d227591a614d..9b6db29570233cb99983762c769a3720fa5f52cc 100644 (file)
@@ -1289,7 +1289,6 @@ static struct dma_async_tx_descriptor *pxp_prep_slave_sg(struct dma_chan *chan,
        struct pxp_tx_desc *desc = NULL;
        struct pxp_tx_desc *first = NULL, *prev = NULL;
        struct scatterlist *sg;
-       unsigned long flags;
        dma_addr_t phys_addr;
        int i;
 
@@ -1302,11 +1301,9 @@ static struct dma_async_tx_descriptor *pxp_prep_slave_sg(struct dma_chan *chan,
        if (unlikely(sg_len < 2))
                return NULL;
 
-       spin_lock_irqsave(&pxp_chan->lock, flags);
        for_each_sg(sgl, sg, sg_len, i) {
                desc = pxpdma_desc_alloc(pxp_chan);
                if (!desc) {
-                       spin_unlock_irqrestore(&pxp_chan->lock, flags);
                        dev_err(chan->device->dev, "no enough memory to allocate tx descriptor\n");
                        return NULL;
                }
@@ -1330,7 +1327,6 @@ static struct dma_async_tx_descriptor *pxp_prep_slave_sg(struct dma_chan *chan,
 
                prev = desc;
        }
-       spin_unlock_irqrestore(&pxp_chan->lock, flags);
 
        pxp->pxp_conf_state.layer_nr = sg_len;
        first->txd.flags = tx_flags;