Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2057647f authored by Micky Ching's avatar Micky Ching Committed by Ulf Hansson
Browse files

mmc: rtsx: init cookie at probe/card_event



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: default avatarMicky Ching <micky_ching@realsil.com.cn>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 755987f9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);