From patchwork Sat May 7 19:15:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Per Forlin X-Patchwork-Id: 1411 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:51:45 -0000 Delivered-To: patches@linaro.org Received: by 10.224.184.145 with SMTP id ck17cs13870qab; Sat, 7 May 2011 12:16:14 -0700 (PDT) Received: by 10.14.122.193 with SMTP id t41mr2612491eeh.198.1304795773396; Sat, 07 May 2011 12:16:13 -0700 (PDT) Received: from mail-ew0-f50.google.com (mail-ew0-f50.google.com [209.85.215.50]) by mx.google.com with ESMTPS id 16si9717040eej.80.2011.05.07.12.16.12 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 May 2011 12:16:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of per.forlin@linaro.org) client-ip=209.85.215.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of per.forlin@linaro.org) smtp.mail=per.forlin@linaro.org Received: by mail-ew0-f50.google.com with SMTP id 10so1407884ewy.37 for ; Sat, 07 May 2011 12:16:12 -0700 (PDT) Received: by 10.14.124.76 with SMTP id w52mr2397770eeh.201.1304795772381; Sat, 07 May 2011 12:16:12 -0700 (PDT) Received: from localhost.localdomain (c-3c7b71d5.029-82-6c756e10.cust.bredbandsbolaget.se [213.113.123.60]) by mx.google.com with ESMTPS id s62sm2260327eea.24.2011.05.07.12.16.10 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 May 2011 12:16:11 -0700 (PDT) From: Per Forlin To: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org Cc: Chris Ball , Per Forlin Subject: [PATCH v3 10/12] omap_hsmmc: use original sg_len for dma_unmap_sg Date: Sat, 7 May 2011 21:15:04 +0200 Message-Id: <1304795706-27308-11-git-send-email-per.forlin@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1304795706-27308-1-git-send-email-per.forlin@linaro.org> References: <1304795706-27308-1-git-send-email-per.forlin@linaro.org> Don't use the returned sg_len from dma_map_sg() as inparameter to dma_unmap_sg(). Use the original sg_len for both dma_map_sg and dma_unmap_sg. Signed-off-by: Per Forlin --- drivers/mmc/host/omap_hsmmc.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 259ece0..ad3731a 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -959,7 +959,8 @@ static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno) spin_unlock(&host->irq_lock); if (host->use_dma && dma_ch != -1) { - dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, host->dma_len, + dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, + host->data->sg_len, omap_hsmmc_get_dma_dir(host, host->data)); omap_free_dma(dma_ch); } @@ -1343,7 +1344,7 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data) return; } - dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_len, + dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, omap_hsmmc_get_dma_dir(host, data)); req_in_progress = host->req_in_progress;