* [3/5] dmaengine: bcm2835: Clean up abort of transactions
@ 2018-12-22 7:28 Lukas Wunner
0 siblings, 0 replies; 2+ messages in thread
From: Lukas Wunner @ 2018-12-22 7:28 UTC (permalink / raw)
To: Vinod Koul, Eric Anholt, Stefan Wahren
Cc: Frank Pavlic, Martin Sperl, Florian Meier, dmaengine,
linux-rpi-kernel
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
wrong anyway, "unsigned long" is 64-bit on arm64, yet the CS register is
32-bit.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Frank Pavlic <f.pavlic@kunbus.de>
Cc: Martin Sperl <kernel@martin.sperl.org>
Cc: Florian Meier <florian.meier@koalo.de>
---
drivers/dma/bcm2835-dma.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index 17bc7304db3a..a3ecb7fd4fc2 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [3/5] dmaengine: bcm2835: Clean up abort of transactions
@ 2019-01-07 8:26 Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2019-01-07 8:26 UTC (permalink / raw)
To: Lukas Wunner
Cc: Eric Anholt, Stefan Wahren, Frank Pavlic, Martin Sperl,
Florian Meier, dmaengine, linux-rpi-kernel
On 22-12-18, 08:28, Lukas Wunner wrote:
> 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...
> wrong anyway, "unsigned long" is 64-bit on arm64, yet the CS register is
> 32-bit.
>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: Frank Pavlic <f.pavlic@kunbus.de>
> Cc: Martin Sperl <kernel@martin.sperl.org>
> Cc: Florian Meier <florian.meier@koalo.de>
> ---
> drivers/dma/bcm2835-dma.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
> index 17bc7304db3a..a3ecb7fd4fc2 100644
> --- a/drivers/dma/bcm2835-dma.c
> +++ b/drivers/dma/bcm2835-dma.c
> @@ -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)
> --
> 2.19.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-07 8:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-07 8:26 [3/5] dmaengine: bcm2835: Clean up abort of transactions Vinod Koul
-- strict thread matches above, loose matches on Subject: below --
2018-12-22 7:28 Lukas Wunner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox