aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2016-01-26 13:40:42 +0000
committerUlf Hansson <ulf.hansson@linaro.org>2016-02-29 11:03:22 +0100
commitadd8913d5d73fe617fd7fa0f62f170c8ac5f313b (patch)
tree7dc9224f5fe9a2ae2a9db92b2abfa73e4fb268e9 /drivers/mmc
parentmmc: sdhci: clean up host cookie handling (diff)
downloadlinux-dev-add8913d5d73fe617fd7fa0f62f170c8ac5f313b.tar.xz
linux-dev-add8913d5d73fe617fd7fa0f62f170c8ac5f313b.zip
mmc: sdhci: cleanup DMA un-mapping
The patch "mmc: sdhci: plug DMA mapping leak on error" added un-mapping logic to sdhci_tasklet_finish() where it is always called, thereby preventing the mapping leaking. Consequently the un-mapping code in sdhci_finish_data() is no longer needed. Remove it. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> [ Split from original "mmc: sdhci: plug DMA mapping leak on error" patch ] Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 16e8db00fc49..082c2f9fbfe6 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -911,17 +911,9 @@ static void sdhci_finish_data(struct sdhci_host *host)
data = host->data;
host->data = NULL;
- if (host->flags & SDHCI_REQ_USE_DMA) {
- if (host->flags & SDHCI_USE_ADMA)
- sdhci_adma_table_post(host, data);
-
- if (data->host_cookie == COOKIE_MAPPED) {
- dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
- (data->flags & MMC_DATA_READ) ?
- DMA_FROM_DEVICE : DMA_TO_DEVICE);
- data->host_cookie = COOKIE_UNMAPPED;
- }
- }
+ if ((host->flags & (SDHCI_REQ_USE_DMA | SDHCI_USE_ADMA)) ==
+ (SDHCI_REQ_USE_DMA | SDHCI_USE_ADMA))
+ sdhci_adma_table_post(host, data);
/*
* The specification states that the block count register must