mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 10:44:14 +08:00
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>
This commit is contained in:
parent
57b772b868
commit
d69d1e17c3
@ -342,10 +342,8 @@ struct sdma_channel {
|
||||
unsigned long event_mask[2];
|
||||
unsigned long watermark_level;
|
||||
u32 shp_addr, per_addr;
|
||||
spinlock_t lock;
|
||||
enum dma_status status;
|
||||
struct imx_dma_data data;
|
||||
bool enabled;
|
||||
};
|
||||
|
||||
#define IMX_DMA_SG_LOOP BIT(0)
|
||||
@ -606,14 +604,7 @@ static int sdma_config_ownership(struct sdma_channel *sdmac,
|
||||
|
||||
static void sdma_enable_channel(struct sdma_engine *sdma, int channel)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct sdma_channel *sdmac = &sdma->channel[channel];
|
||||
|
||||
writel(BIT(channel), sdma->regs + SDMA_H_START);
|
||||
|
||||
spin_lock_irqsave(&sdmac->lock, flags);
|
||||
sdmac->enabled = true;
|
||||
spin_unlock_irqrestore(&sdmac->lock, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -731,14 +722,6 @@ static void sdma_update_channel_loop(struct sdma_channel *sdmac)
|
||||
struct sdma_buffer_descriptor *bd;
|
||||
int error = 0;
|
||||
enum dma_status old_status = sdmac->status;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&sdmac->lock, flags);
|
||||
if (!sdmac->enabled) {
|
||||
spin_unlock_irqrestore(&sdmac->lock, flags);
|
||||
return;
|
||||
}
|
||||
spin_unlock_irqrestore(&sdmac->lock, flags);
|
||||
|
||||
/*
|
||||
* loop mode. Iterate over descriptors, re-setup them and
|
||||
@ -1000,15 +983,10 @@ static int sdma_disable_channel(struct dma_chan *chan)
|
||||
struct sdma_channel *sdmac = to_sdma_chan(chan);
|
||||
struct sdma_engine *sdma = sdmac->sdma;
|
||||
int channel = sdmac->channel;
|
||||
unsigned long flags;
|
||||
|
||||
writel_relaxed(BIT(channel), sdma->regs + SDMA_H_STATSTOP);
|
||||
sdmac->status = DMA_ERROR;
|
||||
|
||||
spin_lock_irqsave(&sdmac->lock, flags);
|
||||
sdmac->enabled = false;
|
||||
spin_unlock_irqrestore(&sdmac->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1922,7 +1900,6 @@ static int sdma_probe(struct platform_device *pdev)
|
||||
struct sdma_channel *sdmac = &sdma->channel[i];
|
||||
|
||||
sdmac->sdma = sdma;
|
||||
spin_lock_init(&sdmac->lock);
|
||||
|
||||
sdmac->channel = i;
|
||||
sdmac->vc.desc_free = sdma_desc_free;
|
||||
|
Loading…
Reference in New Issue
Block a user