Skip to content

Commit

Permalink
mmc: core: Check for non-removable cards earlier in the error path
Browse files Browse the repository at this point in the history
_mmc_detect_card_removed() validates that the card is removable, but when
being called via the bus_ops ->detect() callbacks, the validation is
redundant as it's already done in mmc_rescan().

Move the validation of a removable card to the mmc_detect_card_removed()
API, which is where it's applicable, to allow the blk error recovery path
to get the response a bit earlier.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Ulf Hansson committed Dec 22, 2015
1 parent 8dede18 commit 1ff2575
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2498,9 +2498,6 @@ int _mmc_detect_card_removed(struct mmc_host *host)
{
int ret;

if (host->caps & MMC_CAP_NONREMOVABLE)
return 0;

if (!host->card || mmc_card_removed(host->card))
return 1;

Expand Down Expand Up @@ -2536,6 +2533,9 @@ int mmc_detect_card_removed(struct mmc_host *host)
if (!card)
return 1;

if (host->caps & MMC_CAP_NONREMOVABLE)
return 0;

ret = mmc_card_removed(card);
/*
* The card will be considered unchanged unless we have been asked to
Expand Down

0 comments on commit 1ff2575

Please sign in to comment.