From patchwork Wed Oct 17 13:27:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1605951 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork2.kernel.org (Postfix) with ESMTP id CE7D1DFABE for ; Wed, 17 Oct 2012 13:28:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.b.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1TOTfJ-00006j-87; Wed, 17 Oct 2012 13:28:05 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1TOTfH-00006d-R7 for spi-devel-general@lists.sourceforge.net; Wed, 17 Oct 2012 13:28:03 +0000 X-ACL-Warn: Received: from moutng.kundenserver.de ([212.227.126.186]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1TOTfC-0003T3-0p for spi-devel-general@lists.sourceforge.net; Wed, 17 Oct 2012 13:28:03 +0000 Received: from klappe2.localnet (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0MAX6s-1TCtrI0r9e-00BblV; Wed, 17 Oct 2012 15:27:26 +0200 From: Arnd Bergmann To: Kukjin Kim Subject: Re: [PATCH v2 v2 v2 8/8] spi/s3c64xx: use correct dma_transfer_direction type Date: Wed, 17 Oct 2012 13:27:22 +0000 User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; ) References: <1349813638-4617-1-git-send-email-arnd@arndb.de> <1349813638-4617-9-git-send-email-arnd@arndb.de> <003a01cdac3f$08fe40d0$1afac270$%kim@samsung.com> In-Reply-To: <003a01cdac3f$08fe40d0$1afac270$%kim@samsung.com> MIME-Version: 1.0 Message-Id: <201210171327.23182.arnd@arndb.de> X-Provags-ID: V02:K0:N7eOxEXysJA/wDlAk4ejBPDbGamzTuOp6TAd7fBmLen OzERPO0DDsopiBG1deR9/ziITrII9QbR4UQesEMXtvKCAi6bgg pe5+MFsSivN230ojpzhS9VldugWoQm092GKooHcjwgGpaeH4T4 SAlszkY1PODikrOhOtfJFjzmi+EJPSxyIFGHnDfOlgv08WLVwa QgLJquz75fzGm+FW0A76PjlSQvt0RAqbfQfH+N74dmxmVO3MtS IIFWSwBGYwh1GwwoWFX/Oxagm8RGTvr0ycblwtbc1ZqaBZJF07 rn4Ty7dsn+pFQPZaLfbpKJu+jOVbkZ/VDgjKCsLGrFJp0Tmxhe Q0mX6dLXoAz7tHNDi3tQ= X-Spam-Score: -1.0 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.186 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1TOTfC-0003T3-0p Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, arm@kernel.org, 'Ben Dooks' , spi-devel-general@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net On Wednesday 17 October 2012, Kukjin Kim wrote: > BTW, don't we need following accordingly? > > diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c > index 1a81c90..a0bb55e 100644 > --- a/drivers/spi/spi-s3c64xx.c > +++ b/drivers/spi/spi-s3c64xx.c > @@ -1067,11 +1067,11 @@ static int __devinit s3c64xx_spi_get_dmares( > > if (tx) { > dma_data = &sdd->tx_dma; > - dma_data->direction = DMA_TO_DEVICE; > + dma_data->direction = DMA_MEM_TO_DEV; > chan_str = "tx"; > } else { > dma_data = &sdd->rx_dma; > - dma_data->direction = DMA_FROM_DEVICE; > + dma_data->direction = DMA_DEV_TO_MEM; > chan_str = "rx"; > } > Yes, you are absolutely right, sorry for not seeing that earlier. New version below. Arnd >From c10356b9846b13651a8a24c3a31e029ffe6eafd9 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 30 Apr 2012 16:31:27 +0000 Subject: [PATCH] spi/s3c64xx: use correct dma_transfer_direction type There is a subtle difference between dma_transfer_direction and dma_data_direction: the former is used by the dmaengine framework, while the latter is used by the dma-mapping API. Although the purpose is comparable, the actual values are different and must not be mixed. In this case, the driver just wants to use dma_transfer_direction. Without this patch, building s3c6400_defconfig results in: drivers/spi/spi-s3c64xx.c: In function 's3c64xx_spi_dmacb': drivers/spi/spi-s3c64xx.c:239:21: warning: comparison between 'enum dma_data_direction' and 'enum dma_transfer_direction' [-Wenum-compare] As pointed out by Kukjin Kim, this also changes the use of constants from DMA_FROM_DEVICE/DMA_TO_DEVICE to DMA_DEV_TO_MEM/DMA_MEM_TO_DEV. Signed-off-by: Arnd Bergmann Acked-by: Kukjin Kim Cc: Ben Dooks Cc: Grant Likely Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: spi-devel-general@lists.sourceforge.net ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index d1c8441f..cd43b4b 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -132,7 +132,7 @@ struct s3c64xx_spi_dma_data { unsigned ch; - enum dma_data_direction direction; + enum dma_transfer_direction direction; enum dma_ch dmach; struct property *dma_prop; }; @@ -1065,11 +1065,11 @@ static int __devinit s3c64xx_spi_get_dmares( if (tx) { dma_data = &sdd->tx_dma; - dma_data->direction = DMA_TO_DEVICE; + dma_data->direction = DMA_MEM_TO_DEV; chan_str = "tx"; } else { dma_data = &sdd->rx_dma; - dma_data->direction = DMA_FROM_DEVICE; + dma_data->direction = DMA_DEV_TO_MEM; chan_str = "rx"; }