mmc: sdhci: pass the cookie into sdhci_pre_dma_transfer()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 26 Jan 2016 13:40:27 +0000 (13:40 +0000)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 29 Feb 2016 10:03:21 +0000 (11:03 +0100)
Pass the desired cookie for a successful map.  This is in preparation to
clean up the MAPPED/GIVEN states.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
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>
drivers/mmc/host/sdhci.c

index 8b455cdd940b95e78792ad2628f780dca26856b3..9321d4a5b4e67ee4d2eb51820fdf7ab85041ac8d 100644 (file)
@@ -427,7 +427,7 @@ static void sdhci_transfer_pio(struct sdhci_host *host)
 }
 
 static int sdhci_pre_dma_transfer(struct sdhci_host *host,
-                                 struct mmc_data *data)
+                                 struct mmc_data *data, int cookie)
 {
        int sg_count;
 
@@ -446,7 +446,7 @@ static int sdhci_pre_dma_transfer(struct sdhci_host *host,
                return -ENOSPC;
 
        data->sg_count = sg_count;
-       data->host_cookie = COOKIE_MAPPED;
+       data->host_cookie = cookie;
 
        return sg_count;
 }
@@ -791,7 +791,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
        }
 
        if (host->flags & SDHCI_REQ_USE_DMA) {
-               int sg_cnt = sdhci_pre_dma_transfer(host, data);
+               int sg_cnt = sdhci_pre_dma_transfer(host, data, COOKIE_MAPPED);
 
                if (sg_cnt <= 0) {
                        /*
@@ -2095,7 +2095,7 @@ static void sdhci_pre_req(struct mmc_host *mmc, struct mmc_request *mrq,
        mrq->data->host_cookie = COOKIE_UNMAPPED;
 
        if (host->flags & SDHCI_REQ_USE_DMA)
-               sdhci_pre_dma_transfer(host, mrq->data);
+               sdhci_pre_dma_transfer(host, mrq->data, COOKIE_MAPPED);
 }
 
 static void sdhci_card_event(struct mmc_host *mmc)