From patchwork Tue Apr 25 18:21:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 9699059 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 21D486020A for ; Tue, 25 Apr 2017 18:23:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1201D2041F for ; Tue, 25 Apr 2017 18:23:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 067A428464; Tue, 25 Apr 2017 18:23:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AA182041F for ; Tue, 25 Apr 2017 18:23:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1952631AbdDYSXi (ORCPT ); Tue, 25 Apr 2017 14:23:38 -0400 Received: from ale.deltatee.com ([207.54.116.67]:49971 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1952457AbdDYSVd (ORCPT ); Tue, 25 Apr 2017 14:21:33 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1d355R-0004Kc-9w; Tue, 25 Apr 2017 12:21:27 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.84_2) (envelope-from ) id 1d355O-0005tH-0z; Tue, 25 Apr 2017 12:21:14 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-nvdimm@lists.01.org, linux-scsi@vger.kernel.org, open-iscsi@googlegroups.com, megaraidlinux.pdl@broadcom.com, sparmaintainer@unisys.com, devel@driverdev.osuosl.org, target-devel@vger.kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, dm-devel@redhat.com Cc: Christoph Hellwig , "Martin K. Petersen" , "James E.J. Bottomley" , Jens Axboe , Greg Kroah-Hartman , Dan Williams , Ross Zwisler , Matthew Wilcox , Sumit Semwal , Stephen Bates , Logan Gunthorpe , Sascha Sommer , Ulf Hansson Date: Tue, 25 Apr 2017 12:21:06 -0600 Message-Id: <1493144468-22493-20-git-send-email-logang@deltatee.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1493144468-22493-1-git-send-email-logang@deltatee.com> References: <1493144468-22493-1-git-send-email-logang@deltatee.com> X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-nvdimm@lists.01.org, open-iscsi@googlegroups.com, megaraidlinux.pdl@broadcom.com, sparmaintainer@unisys.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-media@vger.kernel.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, dm-devel@redhat.com, hch@lst.de, martin.petersen@oracle.com, jejb@linux.vnet.ibm.com, axboe@kernel.dk, gregkh@linuxfoundation.org, dan.j.williams@intel.com, ross.zwisler@linux.intel.com, mawilcox@microsoft.com, sbates@raithlin.com, logang@deltatee.com, saschasommer@freenet.de, sumit.semwal@linaro.org, ulf.hansson@linaro.org X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH v2 19/21] mmc: sdricoh_cs: Make use of the new sg_map helper function X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is a straightforward conversion to the new function. Signed-off-by: Logan Gunthorpe Cc: Sascha Sommer Cc: Ulf Hansson --- drivers/mmc/host/sdricoh_cs.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/sdricoh_cs.c b/drivers/mmc/host/sdricoh_cs.c index 5ff26ab..03225c3 100644 --- a/drivers/mmc/host/sdricoh_cs.c +++ b/drivers/mmc/host/sdricoh_cs.c @@ -319,16 +319,20 @@ static void sdricoh_request(struct mmc_host *mmc, struct mmc_request *mrq) for (i = 0; i < data->blocks; i++) { size_t len = data->blksz; u8 *buf; - struct page *page; int result; - page = sg_page(data->sg); - buf = kmap(page) + data->sg->offset + (len * i); + buf = sg_map(data->sg, (len * i), SG_KMAP); + if (IS_ERR(buf)) { + cmd->error = PTR_ERR(buf); + break; + } + result = sdricoh_blockio(host, data->flags & MMC_DATA_READ, buf, len); - kunmap(page); - flush_dcache_page(page); + sg_unmap(data->sg, buf, (len * i), SG_KMAP); + + flush_dcache_page(sg_page(data->sg)); if (result) { dev_err(dev, "sdricoh_request: cmd %i " "block transfer failed\n", cmd->opcode);