cmd: mmc: Force mmc reinit when no card present
In case the card is removed, force-init the MMC to start the internal
machinery which deregisters and invalidate the MMC device.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
diff --git a/cmd/mmc.c b/cmd/mmc.c
index 3920a18..ca8f982 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -101,6 +101,9 @@
return NULL;
}
+ if (!mmc_getcd(mmc))
+ force_init = true;
+
if (force_init)
mmc->has_init = 0;
if (mmc_init(mmc))