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

Commit 833bc03b authored by Javier Martin's avatar Javier Martin Committed by Vinod Koul
Browse files

dmaengine: imx-dma: remove sg member from internal structure.



This member is redundant, because it is already present in
descriptor structure. Removing it will make further removing
of 'internal' structure easier.

Signed-off-by: default avatarJavier Martin <javier.martin@vista-silicon.com>
Acked-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarVinod Koul <vinod.koul@linux.intel.com>
parent 359291a1
Loading
Loading
Loading
Loading
+18 −24
Original line number Diff line number Diff line
@@ -129,7 +129,6 @@ enum imxdma_prep_type {
 */

struct imxdma_channel_internal {
	struct scatterlist *sg;
	unsigned int resbytes;

	int in_use;
@@ -278,11 +277,11 @@ static void imxdma_enable_hw(struct imxdma_desc *d)
		CCR_ACRPT, DMA_CCR(channel));

	if ((cpu_is_mx21() || cpu_is_mx27()) &&
			imxdmac->internal.sg && imxdma_hw_chain(&imxdmac->internal)) {
		imxdmac->internal.sg = sg_next(imxdmac->internal.sg);
		if (imxdmac->internal.sg) {
			d->sg && imxdma_hw_chain(&imxdmac->internal)) {
		d->sg = sg_next(d->sg);
		if (d->sg) {
			u32 tmp;
			imxdma_sg_next(d, imxdmac->internal.sg);
			imxdma_sg_next(d, d->sg);
			tmp = imx_dmav1_readl(DMA_CCR(channel));
			imx_dmav1_writel(tmp | CCR_RPT | CCR_ACRPT,
				DMA_CCR(channel));
@@ -319,7 +318,6 @@ static void imxdma_watchdog(unsigned long data)

	imx_dmav1_writel(0, DMA_CCR(channel));
	imxdmac->internal.in_use = 0;
	imxdmac->internal.sg = NULL;

	/* Tasklet watchdog error handler */
	tasklet_schedule(&imxdmac->dma_tasklet);
@@ -387,12 +385,6 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac)
	int chno = imxdmac->channel;
	struct imxdma_desc *desc;

	if (imxdma->sg) {
		u32 tmp;
		imxdma->sg = sg_next(imxdma->sg);

		if (imxdma->sg) {

	spin_lock(&imxdmac->lock);
	if (list_empty(&imxdmac->ld_active)) {
		spin_unlock(&imxdmac->lock);
@@ -404,7 +396,12 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac)
				node);
	spin_unlock(&imxdmac->lock);

			imxdma_sg_next(desc, imxdma->sg);
	if (desc->sg) {
		u32 tmp;
		desc->sg = sg_next(desc->sg);

		if (desc->sg) {
			imxdma_sg_next(desc, desc->sg);

			tmp = imx_dmav1_readl(DMA_CCR(chno));

@@ -477,8 +474,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
	/* Configure and enable */
	switch (d->type) {
	case IMXDMA_DESC_MEMCPY:
		imxdmac->internal.sg = NULL;

		imx_dmav1_writel(d->src, DMA_SAR(imxdmac->channel));
		imx_dmav1_writel(d->dest, DMA_DAR(imxdmac->channel));
		imx_dmav1_writel(d->config_mem | (d->config_port << 2),
@@ -494,7 +489,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
	/* Cyclic transfer is the same as slave_sg with special sg configuration. */
	case IMXDMA_DESC_CYCLIC:
	case IMXDMA_DESC_SLAVE_SG:
		imxdmac->internal.sg = d->sg;
		imxdmac->internal.resbytes = d->len;

		if (d->direction == DMA_DEV_TO_MEM) {