]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dmaengine: Provide a wrapper for memcpy operations
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Fri, 27 Jan 2017 16:42:01 +0000 (17:42 +0100)
committerVinod Koul <vinod.koul@intel.com>
Tue, 31 Jan 2017 03:33:20 +0000 (09:03 +0530)
Almost all ->device_prep_dma_xx() methods have a wrapper defined in
dmaengine.h. Add one for  ->device_prep_dma_memcpy().

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
include/linux/dmaengine.h

index feee6ec6a13bbba6762618c21812754e3320684d..533680860865a2f6b64d0f73d3fb9040e097657b 100644 (file)
@@ -894,6 +894,17 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_memset(
                                                    len, flags);
 }
 
+static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_memcpy(
+               struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
+               size_t len, unsigned long flags)
+{
+       if (!chan || !chan->device || !chan->device->device_prep_dma_memcpy)
+               return NULL;
+
+       return chan->device->device_prep_dma_memcpy(chan, dest, src,
+                                                   len, flags);
+}
+
 static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_sg(
                struct dma_chan *chan,
                struct scatterlist *dst_sg, unsigned int dst_nents,