Skip to contentSkip to conversation

dmaengine: bcm2835: Clean up abort of transactions

PATCH New Vinod Koul 1 participant 1 message Jan 7, 2019 dmaengine

lore
Share & tools
lore

Vinod Koul

author maintainer
#0 lore raw

PATCH 3/5 dmaengine: bcm2835: Clean up abort of transactions

Quoted 5 lines · Lukas Wunner

bcm2835_dma_abort() returns an int but bcm2835_dma_terminate_all() (its sole caller) does not evaluate the return value. Change the return type to void.

Also, the "cs" variable is dispensable, so remove it. Its type seems

Please make it two different commits...

Quoted 43 lines

wrong anyway, "unsigned long" is 64-bit on arm64, yet the CS register is 32-bit.

Cc Frank Pavlic <[email protected]>
Cc Martin Sperl <[email protected]>
Cc Florian Meier <[email protected]>
---
 drivers/dma/bcm2835-dma.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/dma/bcm2835-dma.c +3 -6
index 17bc7304db3a..a3ecb7fd4fc2 100644
@@ -406,14 +406,12 @@ static void bcm2835_dma_fill_cb_chain_with_sg(
 	}
 }
 
-static int bcm2835_dma_abort(void __iomem *chan_base)
+static void bcm2835_dma_abort(void __iomem *chan_base)
 {
-	unsigned long cs;
 	long int timeout = 10000;
 
-	cs = readl(chan_base + BCM2835_DMA_CS);
-	if (!(cs & BCM2835_DMA_ACTIVE))
-		return 0;
+	if (!(readl(chan_base + BCM2835_DMA_CS) & BCM2835_DMA_ACTIVE))
+		return;
 
 	/* Write 0 to the active bit - Pause the DMA */
 	writel(0, chan_base + BCM2835_DMA_CS);
@@ -424,7 +422,6 @@ static int bcm2835_dma_abort(void __iomem *chan_base)
 		cpu_relax();
 
 	writel(BCM2835_DMA_RESET, chan_base + BCM2835_DMA_CS);
-	return 0;
 }
 
 static void bcm2835_dma_start_desc(struct bcm2835_chan *c)
Signature · 1 line
2.19.2