From 88ef05c6d31c7afef61792d5e53f0bc1ecd1c842 Mon Sep 17 00:00:00 2001 From: Fancy Fang Date: Mon, 16 Dec 2013 13:34:25 +0800 Subject: [PATCH] ENGR00292129 PXP: remove some unnecessary code from PXP dma driver There is no need to use spin lock in pxp_prep_slave_sg() after dynamic descriptors allocation enabled. Signed-off-by: Fancy Fang --- drivers/dma/pxp/pxp_dma_v2.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/dma/pxp/pxp_dma_v2.c b/drivers/dma/pxp/pxp_dma_v2.c index 4cbcde596005..9b6db2957023 100644 --- a/drivers/dma/pxp/pxp_dma_v2.c +++ b/drivers/dma/pxp/pxp_dma_v2.c @@ -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; -- 2.39.5