summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2019-01-03 22:09:43 +0100
committerTom Rini <trini@konsulko.com>2019-01-15 15:28:43 -0500
commitd2a083696e403aa34288638fcef943deedaf1492 (patch)
tree0000e3672254c1d19306b3969d6232cf97599568
parentb9a2a0e2e9c024009010a9755d5377795f660b1a (diff)
downloadu-boot-d2a083696e403aa34288638fcef943deedaf1492.tar.gz
u-boot-d2a083696e403aa34288638fcef943deedaf1492.tar.bz2
u-boot-d2a083696e403aa34288638fcef943deedaf1492.zip
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>
-rw-r--r--cmd/mmc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/mmc.c b/cmd/mmc.c
index 3920a1836a..ca8f982f53 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -101,6 +101,9 @@ static struct mmc *init_mmc_device(int dev, bool force_init)
return NULL;
}
+ if (!mmc_getcd(mmc))
+ force_init = true;
+
if (force_init)
mmc->has_init = 0;
if (mmc_init(mmc))