Merge branch 'topic/of' into for-linus
authorVinod Koul <vinod.koul@intel.com>
Tue, 7 Jan 2014 16:06:24 +0000 (21:36 +0530)
committerVinod Koul <vinod.koul@intel.com>
Tue, 7 Jan 2014 16:06:24 +0000 (21:36 +0530)
Conflicts:
drivers/dma/mmp_pdma.c

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
1  2 
drivers/dma/dmaengine.c
drivers/dma/mmp_pdma.c
include/linux/dmaengine.h

Simple merge
index 3f7712c4d3fa782bd8ae985d182ed8d6ebb48d78,2998f1bffac11882bc5fe5cc3e1ca551f0739540..c1b7c3ac7676222f5e02785970e44ec6cdb210ea
@@@ -898,30 -893,15 +898,21 @@@ static struct dma_chan *mmp_pdma_dma_xl
                                           struct of_dma *ofdma)
  {
        struct mmp_pdma_device *d = ofdma->of_dma_data;
-       struct dma_chan *chan, *candidate;
+       struct dma_chan *chan;
+       struct mmp_pdma_chan *c;
  
- retry:
-       candidate = NULL;
-       /* walk the list of channels registered with the current instance and
-        * find one that is currently unused */
-       list_for_each_entry(chan, &d->device.channels, device_node)
-               if (chan->client_count == 0) {
-                       candidate = chan;
-                       break;
-               }
-       if (!candidate)
+       chan = dma_get_any_slave_channel(&d->device);
+       if (!chan)
                return NULL;
  
 -      c = to_mmp_pdma_chan(chan);
 -      c->drcmr = dma_spec->args[0];
 +      /* dma_get_slave_channel will return NULL if we lost a race between
 +       * the lookup and the reservation */
 +      chan = dma_get_slave_channel(candidate);
 +
 +      if (!chan)
 +              goto retry;
 +
 +      to_mmp_pdma_chan(chan)->drcmr = dma_spec->args[0];
  
        return chan;
  }
Simple merge