DMAENGINE: ste_dma40: don't pause/resume non-executing channels
authorJonas Aaberg <jonas.aberg@stericsson.com>
Mon, 9 Aug 2010 12:09:12 +0000 (12:09 +0000)
committerDan Williams <dan.j.williams@intel.com>
Wed, 22 Sep 2010 21:53:47 +0000 (14:53 -0700)
There is no point in pausing what isn't running.

Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/ste_dma40.c

index c9f485e3baeb2ea31e993d29df2a945b53af0885..05d0a9937617e96c2cc5c0435a6ca6e831b5aa34 100644 (file)
@@ -768,6 +768,9 @@ static int d40_pause(struct dma_chan *chan)
        int res = 0;
        unsigned long flags;
 
+       if (!d40c->busy)
+               return 0;
+
        spin_lock_irqsave(&d40c->lock, flags);
 
        res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ);
@@ -792,6 +795,9 @@ static int d40_resume(struct dma_chan *chan)
        int res = 0;
        unsigned long flags;
 
+       if (!d40c->busy)
+               return 0;
+
        spin_lock_irqsave(&d40c->lock, flags);
 
        if (d40c->base->rev == 0)