From patchwork Sun Aug 11 00:33:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2842548 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 095109F294 for ; Sun, 11 Aug 2013 00:34:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DA61201D3 for ; Sun, 11 Aug 2013 00:34:44 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2119A201BD for ; Sun, 11 Aug 2013 00:34:43 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Jbw-0002md-HH; Sun, 11 Aug 2013 00:34:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Jbu-0005PG-7W; Sun, 11 Aug 2013 00:34:18 +0000 Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Jbr-0005Nl-40 for linux-arm-kernel@lists.infradead.org; Sun, 11 Aug 2013 00:34:16 +0000 Received: by mail-ea0-f171.google.com with SMTP id n15so2702205ead.16 for ; Sat, 10 Aug 2013 17:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QyFViSraC382/UTA4gKI9GWBym2m7JESAmNz5ymjCtQ=; b=QTwj/AlurkW3mju/nTX0WG7DAEDDh2SnkMqpHW/SvSgYhIxlbIo/z5/C1MBhlm4keN KWB7xCo+T5ybItuo3g/YPXMjQkrhHUnJ4eLBp+zpdcHSBk5NQbpgnK17YTQ3sq0f3LJs sAAndXIlcscT+Yg4AriIoBWYYjA+TCiaRuRwwEd/rjTvD3MW34QsxwsfFYw8rEosYznT LKsJpPCsNXy1OhQC7qwEGuSOhcdfW5Qs/5nvT3S+zSobQEVloUZDJ+Oewm7QQzxglG0p EOR1jqhXwa3ulDAbmUjcUneJ6sS/FOVZT5JAcWSHRyLyex0Ov45SqyReHQseXgyJs2+I QLnw== X-Received: by 10.14.184.4 with SMTP id r4mr19184075eem.100.1376181232575; Sat, 10 Aug 2013 17:33:52 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id r48sm36159729eev.14.2013.08.10.17.33.50 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 Aug 2013 17:33:51 -0700 (PDT) From: Tomasz Figa To: linux-spi@vger.kernel.org Subject: [PATCH 3/3] spi: s3c64xx: Use dmaengine_prep_slave_single() to prepare DMA transfers Date: Sun, 11 Aug 2013 02:33:30 +0200 Message-Id: <1376181210-14599-3-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1376181210-14599-1-git-send-email-tomasz.figa@gmail.com> References: <1376181210-14599-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130810_203415_347691_B25D9A40 X-CRM114-Status: GOOD ( 10.55 ) X-Spam-Score: -2.0 (--) Cc: Kukjin Kim , Mark Brown , linux-samsung-soc@vger.kernel.org, Tomasz Figa , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since the driver supports only contiguous buffers, there is no need to manually construct a scatterlist with just a single entry, when there is a dedicated helper for this purpose. This patch modifies prepare_dma() function to use available helper instead of manually creating a scatterlist. Signed-off-by: Tomasz Figa --- drivers/spi/spi-s3c64xx.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 597dc2f..9b4e54d 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -386,7 +386,6 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma, { struct s3c64xx_spi_driver_data *sdd; struct dma_slave_config config; - struct scatterlist sg; struct dma_async_tx_descriptor *desc; memset(&config, 0, sizeof(config)); @@ -409,14 +408,8 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma, dmaengine_slave_config(dma->ch, &config); } - sg_init_table(&sg, 1); - sg_dma_len(&sg) = len; - sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)), - len, offset_in_page(buf)); - sg_dma_address(&sg) = buf; - - desc = dmaengine_prep_slave_sg(dma->ch, - &sg, 1, dma->direction, DMA_PREP_INTERRUPT); + desc = dmaengine_prep_slave_single(dma->ch, buf, len, + dma->direction, DMA_PREP_INTERRUPT); desc->callback = s3c64xx_spi_dmacb; desc->callback_param = dma;