dmaengine: jz4780: Use dma_get_slave_channel when requesting a specific channel
authorAlex Smith <alex.smith@imgtec.com>
Fri, 24 Jul 2015 16:24:23 +0000 (17:24 +0100)
committerVinod Koul <vinod.koul@intel.com>
Tue, 18 Aug 2015 16:58:49 +0000 (22:28 +0530)
When the DT requests a specific channel to use it is not necesssary
to scan through all DMA channels in the system. Just return the
requested channel using dma_get_slave_channel().

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: dmaengine@vger.kernel.org
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/dma-jz4780.c

index e4a291c67e2a3257d607b8a4537dbcf503583c81..40baaf00b971319b3a1924b016985f9b93fdd1a4 100644 (file)
@@ -726,9 +726,14 @@ static struct dma_chan *jz4780_of_dma_xlate(struct of_phandle_args *dma_spec,
                                data.channel);
                        return NULL;
                }
-       }
 
-       return dma_request_channel(mask, jz4780_dma_filter_fn, &data);
+               jzdma->chan[data.channel].transfer_type = data.transfer_type;
+
+               return dma_get_slave_channel(
+                       &jzdma->chan[data.channel].vchan.chan);
+       } else {
+               return dma_request_channel(mask, jz4780_dma_filter_fn, &data);
+       }
 }
 
 static int jz4780_dma_probe(struct platform_device *pdev)