Thread (82 messages) 82 messages, 9 authors, 2012-06-18

[CFT 01/11] dmaengine: add OMAP DMA engine driver

flat view

From: Russell King - ARM Linux <hidden>
Date: 2012-06-08 09:02:00
Also in: linux-omap
Subsystem: dma generic offload engine subsystem, the rest · Maintainers: Vinod Koul, Linus Torvalds

On Thu, Jun 07, 2012 at 12:06:32PM +0100, Russell King wrote:
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <redacted>
---
 drivers/dma/Kconfig      |    6 +
 drivers/dma/Makefile     |    1 +
 drivers/dma/omap-dma.c   |  522 ++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/omap-dma.h |   24 ++
 4 files changed, 553 insertions(+), 0 deletions(-)
 create mode 100644 drivers/dma/omap-dma.c
 create mode 100644 include/linux/omap-dma.h
There is a bug in here which no one has spotted... I just noticed it.
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 500bc71..02eb2fd 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -130,14 +130,13 @@ static void omap_dma_callback(int ch, u16 status, void *data)
 
 	spin_lock_irqsave(&c->vc.lock, flags);
 	d = c->desc;
-	if (!d)
-		return;
-
-	if (++c->sgidx < d->sglen) {
-		omap_dma_start_sg(c, d, c->sgidx);
-	} else {
-		omap_dma_start_desc(c);
-		vchan_cookie_complete(&d->vd);
+	if (d) {
+		if (++c->sgidx < d->sglen) {
+			omap_dma_start_sg(c, d, c->sgidx);
+		} else {
+			omap_dma_start_desc(c);
+			vchan_cookie_complete(&d->vd);
+		}
 	}
 	spin_unlock_irqrestore(&c->vc.lock, flags);
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help