From patchwork Fri Jan 27 16:34:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 720826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3v94FN2D99z9tk1 for ; Sat, 28 Jan 2017 03:37:12 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933696AbdA0QfA (ORCPT ); Fri, 27 Jan 2017 11:35:00 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:57593 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932801AbdA0Qew (ORCPT ); Fri, 27 Jan 2017 11:34:52 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 6D97720E26; Fri, 27 Jan 2017 17:34:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 08B2020B7B; Fri, 27 Jan 2017 17:34:13 +0100 (CET) From: Boris Brezillon To: Boris Brezillon , Richard Weinberger , linux-mtd@lists.infradead.org, Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org, Vinod Koul , Dan Williams , dmaengine@vger.kernel.org, Nicolas Ferre , Alexandre Belloni , Wenyou Yang , Josh Wu , Haavard Skinnemoen , Hans-Christian Egtvedt , linux-kernel@vger.kernel.org Cc: David Woodhouse , Brian Norris , Marek Vasut , Cyrille Pitchen , linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/5] dmaengine: Provide a wrapper for memcpy operations Date: Fri, 27 Jan 2017 17:34:03 +0100 Message-Id: <1485534846-28111-3-git-send-email-boris.brezillon@free-electrons.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485534846-28111-1-git-send-email-boris.brezillon@free-electrons.com> References: <1485534846-28111-1-git-send-email-boris.brezillon@free-electrons.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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 --- include/linux/dmaengine.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index feee6ec6a13b..533680860865 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -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,