Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d69d1e17 authored by Robin Gong's avatar Robin Gong Committed by Vinod Koul
Browse files

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: default avatarRobin Gong <yibin.gong@nxp.com>
Reviewed-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Tested-by: default avatarLucas Stach <l.stach@pengutronix.de>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 57b772b8
Loading
Loading
Loading
Loading
+0 −23
Original line number Original line Diff line number Diff line
@@ -342,10 +342,8 @@ struct sdma_channel {
	unsigned long			event_mask[2];
	unsigned long			event_mask[2];
	unsigned long			watermark_level;
	unsigned long			watermark_level;
	u32				shp_addr, per_addr;
	u32				shp_addr, per_addr;
	spinlock_t			lock;
	enum dma_status			status;
	enum dma_status			status;
	struct imx_dma_data		data;
	struct imx_dma_data		data;
	bool				enabled;
};
};


#define IMX_DMA_SG_LOOP		BIT(0)
#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)
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);
	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;
	struct sdma_buffer_descriptor *bd;
	int error = 0;
	int error = 0;
	enum dma_status	old_status = sdmac->status;
	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
	 * 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_channel *sdmac = to_sdma_chan(chan);
	struct sdma_engine *sdma = sdmac->sdma;
	struct sdma_engine *sdma = sdmac->sdma;
	int channel = sdmac->channel;
	int channel = sdmac->channel;
	unsigned long flags;


	writel_relaxed(BIT(channel), sdma->regs + SDMA_H_STATSTOP);
	writel_relaxed(BIT(channel), sdma->regs + SDMA_H_STATSTOP);
	sdmac->status = DMA_ERROR;
	sdmac->status = DMA_ERROR;


	spin_lock_irqsave(&sdmac->lock, flags);
	sdmac->enabled = false;
	spin_unlock_irqrestore(&sdmac->lock, flags);

	return 0;
	return 0;
}
}


@@ -1922,7 +1900,6 @@ static int sdma_probe(struct platform_device *pdev)
		struct sdma_channel *sdmac = &sdma->channel[i];
		struct sdma_channel *sdmac = &sdma->channel[i];


		sdmac->sdma = sdma;
		sdmac->sdma = sdma;
		spin_lock_init(&sdmac->lock);


		sdmac->channel = i;
		sdmac->channel = i;
		sdmac->vc.desc_free = sdma_desc_free;
		sdmac->vc.desc_free = sdma_desc_free;