mmc: rtsx: init cookie at probe/card_event
authorMicky Ching <micky_ching@realsil.com.cn>
Tue, 23 Dec 2014 01:19:43 +0000 (09:19 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 19 Jan 2015 08:56:19 +0000 (09:56 +0100)
host->cookie is used for handle async request,
we should init it to negative value when new card inserted,
make cookie value invalid.

Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/rtsx_pci_sdmmc.c

index b1390f02f128eac86453456d0a6680744fa57eb3..90b7b6d5141d49fe3f2ff0bcd06c854d25dc16a8 100644 (file)
@@ -1321,6 +1321,7 @@ static void rtsx_pci_sdmmc_card_event(struct platform_device *pdev)
 {
        struct realtek_pci_sdmmc *host = platform_get_drvdata(pdev);
 
+       host->cookie = -1;
        mmc_detect_change(host->mmc, 0);
 }
 
@@ -1353,6 +1354,7 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)
        host->pcr = pcr;
        host->mmc = mmc;
        host->pdev = pdev;
+       host->cookie = -1;
        host->power_state = SDMMC_POWER_OFF;
        INIT_WORK(&host->work, sd_request);
        platform_set_drvdata(pdev, host);