Skip to content

Commit

Permalink
cmd: mmc: Force mmc reinit when no card present
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Jaehoon Chung <[email protected]>
  • Loading branch information
marex authored and trini committed Jan 15, 2019
1 parent b9a2a0e commit d2a0836
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit d2a0836

Please sign in to comment.