From: Marek Vasut Date: Thu, 3 Jan 2019 21:09:43 +0000 (+0100) Subject: cmd: mmc: Force mmc reinit when no card present X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=d2a083696e403aa34288638fcef943deedaf1492;p=u-boot.git 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 Cc: Jaehoon Chung --- 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))