aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Gong <yibin.gong@nxp.com>2018-06-19 12:57:01 -0400
committerVinod Koul <vkoul@kernel.org>2018-07-02 08:54:47 -0400
commitd69d1e17c39e0a14f743da72a9e35796e1fd0f87 (patch)
tree65dd98221ea61a1b6b951d9ba57e468275d5bdc4
parent57b772b86871e025c1fc149d8c3e48667be0869f (diff)
dmaengine: imx-sdma: remove useless 'lock' and 'enabled' in 'struct sdma_channel'
Since 'sdmac->vc.lock' and 'sdmac->desc' can be used as 'lock' and 'enabled' in 'struct sdma_channel sdmac', remove them. Signed-off-by: Robin Gong <yibin.gong@nxp.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/imx-sdma.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 86fa7994a5fd..d1d3494eba01 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -342,10 +342,8 @@ struct sdma_channel {
342 unsigned long event_mask[2]; 342 unsigned long event_mask[2];
343 unsigned long watermark_level; 343 unsigned long watermark_level;
344 u32 shp_addr, per_addr; 344 u32 shp_addr, per_addr;
345 spinlock_t lock;
346 enum dma_status status; 345 enum dma_status status;
347 struct imx_dma_data data; 346 struct imx_dma_data data;
348 bool enabled;
349}; 347};
350 348
351#define IMX_DMA_SG_LOOP BIT(0) 349#define IMX_DMA_SG_LOOP BIT(0)
@@ -606,14 +604,7 @@ static int sdma_config_ownership(struct sdma_channel *sdmac,
606 604
607static void sdma_enable_channel(struct sdma_engine *sdma, int channel) 605static void sdma_enable_channel(struct sdma_engine *sdma, int channel)
608{ 606{
609 unsigned long flags;
610 struct sdma_channel *sdmac = &sdma->channel[channel];
611
612 writel(BIT(channel), sdma->regs + SDMA_H_START); 607 writel(BIT(channel), sdma->regs + SDMA_H_START);
613
614 spin_lock_irqsave(&sdmac->lock, flags);
615 sdmac->enabled = true;
616 spin_unlock_irqrestore(&sdmac->lock, flags);
617} 608}
618 609
619/* 610/*
@@ -731,14 +722,6 @@ static void sdma_update_channel_loop(struct sdma_channel *sdmac)
731 struct sdma_buffer_descriptor *bd; 722 struct sdma_buffer_descriptor *bd;
732 int error = 0; 723 int error = 0;
733 enum dma_status old_status = sdmac->status; 724 enum dma_status old_status = sdmac->status;
734 unsigned long flags;
735
736 spin_lock_irqsave(&sdmac->lock, flags);
737 if (!sdmac->enabled) {
738 spin_unlock_irqrestore(&sdmac->lock, flags);
739 return;
740 }
741 spin_unlock_irqrestore(&sdmac->lock, flags);
742 725
743 /* 726 /*
744 * loop mode. Iterate over descriptors, re-setup them and 727 * loop mode. Iterate over descriptors, re-setup them and
@@ -1000,15 +983,10 @@ static int sdma_disable_channel(struct dma_chan *chan)
1000 struct sdma_channel *sdmac = to_sdma_chan(chan); 983 struct sdma_channel *sdmac = to_sdma_chan(chan);
1001 struct sdma_engine *sdma = sdmac->sdma; 984 struct sdma_engine *sdma = sdmac->sdma;
1002 int channel = sdmac->channel; 985 int channel = sdmac->channel;
1003 unsigned long flags;
1004 986
1005 writel_relaxed(BIT(channel), sdma->regs + SDMA_H_STATSTOP); 987 writel_relaxed(BIT(channel), sdma->regs + SDMA_H_STATSTOP);
1006 sdmac->status = DMA_ERROR; 988 sdmac->status = DMA_ERROR;
1007 989
1008 spin_lock_irqsave(&sdmac->lock, flags);
1009 sdmac->enabled = false;
1010 spin_unlock_irqrestore(&sdmac->lock, flags);
1011
1012 return 0; 990 return 0;
1013} 991}
1014 992
@@ -1922,7 +1900,6 @@ static int sdma_probe(struct platform_device *pdev)
1922 struct sdma_channel *sdmac = &sdma->channel[i]; 1900 struct sdma_channel *sdmac = &sdma->channel[i];
1923 1901
1924 sdmac->sdma = sdma; 1902 sdmac->sdma = sdma;
1925 spin_lock_init(&sdmac->lock);
1926 1903
1927 sdmac->channel = i; 1904 sdmac->channel = i;
1928 sdmac->vc.desc_free = sdma_desc_free; 1905 sdmac->vc.desc_free = sdma_desc_free;