From patchwork Fri Jun 17 18:14:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Per Forlin X-Patchwork-Id: 2036 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 04A6D23E54 for ; Fri, 17 Jun 2011 18:15:10 +0000 (UTC) Received: from mail-vx0-f180.google.com (mail-vx0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id B3E05A1843B for ; Fri, 17 Jun 2011 18:15:09 +0000 (UTC) Received: by vxd7 with SMTP id 7so672320vxd.11 for ; Fri, 17 Jun 2011 11:15:09 -0700 (PDT) Received: by 10.52.98.97 with SMTP id eh1mr3594658vdb.7.1308334509023; Fri, 17 Jun 2011 11:15:09 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs265794vdc; Fri, 17 Jun 2011 11:15:08 -0700 (PDT) Received: by 10.204.171.65 with SMTP id g1mr1911696bkz.45.1308334507173; Fri, 17 Jun 2011 11:15:07 -0700 (PDT) Received: from mail-bw0-f50.google.com (mail-bw0-f50.google.com [209.85.214.50]) by mx.google.com with ESMTPS id e15si8630890bka.72.2011.06.17.11.15.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 17 Jun 2011 11:15:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.50 is neither permitted nor denied by best guess record for domain of per.forlin@linaro.org) client-ip=209.85.214.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.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 bwz2 with SMTP id 2so3055523bwz.37 for ; Fri, 17 Jun 2011 11:15:05 -0700 (PDT) Received: by 10.204.101.73 with SMTP id b9mr1933789bko.85.1308334504946; Fri, 17 Jun 2011 11:15:04 -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 v6sm2206057bkf.23.2011.06.17.11.15.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 17 Jun 2011 11:15:03 -0700 (PDT) From: Per Forlin To: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-dev@lists.linaro.org, Venkatraman S Cc: Chris Ball , Per Forlin Subject: [PATCH RESEND] omap_hsmmc: use original sg_len for dma_unmap_sg Date: Fri, 17 Jun 2011 20:14:21 +0200 Message-Id: <1308334461-3869-1-git-send-email-per.forlin@linaro.org> X-Mailer: git-send-email 1.7.4.1 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 according to the documentation in DMA-API.txt. Signed-off-by: Per Forlin Reviewed-by: Venkatraman S --- 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;