aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2015-11-05 10:21:39 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2015-12-22 05:32:04 -0500
commit1ff2575bcf42caefaaab8e2fb00e238852fac8e2 (patch)
treef8c38447733fc89d6fdb0ceef3275526b7a09e09 /drivers/mmc
parent8dede18e2e86c8e272cd74e66b0e86872cbe7e02 (diff)
mmc: core: Check for non-removable cards earlier in the error path
_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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 18a3f2c41136..a450e91504f3 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2498,9 +2498,6 @@ int _mmc_detect_card_removed(struct mmc_host *host)
2498{ 2498{
2499 int ret; 2499 int ret;
2500 2500
2501 if (host->caps & MMC_CAP_NONREMOVABLE)
2502 return 0;
2503
2504 if (!host->card || mmc_card_removed(host->card)) 2501 if (!host->card || mmc_card_removed(host->card))
2505 return 1; 2502 return 1;
2506 2503
@@ -2536,6 +2533,9 @@ int mmc_detect_card_removed(struct mmc_host *host)
2536 if (!card) 2533 if (!card)
2537 return 1; 2534 return 1;
2538 2535
2536 if (host->caps & MMC_CAP_NONREMOVABLE)
2537 return 0;
2538
2539 ret = mmc_card_removed(card); 2539 ret = mmc_card_removed(card);
2540 /* 2540 /*
2541 * The card will be considered unchanged unless we have been asked to 2541 * The card will be considered unchanged unless we have been asked to