fix bug:It did not respond with the removal of card at the first time if you reboot...
[firefly-linux-kernel-4.4.55.git] / drivers / mmc / host / rk29_sdmmc.c
index 650ef1d264cf67e6a2321723cc78d6ad709c5037..c9ed1c8522cb1b415e7c356cc678fb30b9296ca8 100755 (executable)
@@ -3046,7 +3046,14 @@ static int rk29_sdmmc_probe(struct platform_device *pdev)
 
     if(RK29_CTRL_SDMMC_ID== host->pdev->id)
     {
-        clear_bit(RK29_SDMMC_CARD_PRESENT, &host->flags);
+        if(rk29_sdmmc_get_cd(host->mmc))
+        {
+            set_bit(RK29_SDMMC_CARD_PRESENT, &host->flags);
+        }
+        else
+        {
+            clear_bit(RK29_SDMMC_CARD_PRESENT, &host->flags);
+        }
     }