aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-04-18 05:02:07 -0400
committerChris Ball <cjb@laptop.org>2013-05-26 14:23:12 -0400
commitb689167984bc14ed06c8bcff52ef5eb1fd9cf83b (patch)
treeced0bd9a9f01d0cd39f638af697160b4e4e42e88 /drivers/mmc/core
parent810e08ee425f8d7327e4b30069a9b2b3dccfc67d (diff)
mmc: core: Re-use code for MMC_CAP2_DETECT_ON_ERR in polling mode
Previously the MMC_CAP2_DETECT_ON_ERR was invented for detecting slow card removal. In was never a realy good solution and a proper fix has been merged using gpio debouncing instead. We remove this cap in this patch. Although when using polling card detect mode, the code invented for MMC_CAP2_DETECT_ON_ERR is re-used to complete card removal in an earlier phase. There are no need waiting for the polling timeout to elapse in this case. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Liu <kliu5@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index c40396f23202..6e4d04df37e0 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2325,14 +2325,13 @@ int mmc_detect_card_removed(struct mmc_host *host)
2325 * The card will be considered unchanged unless we have been asked to 2325 * The card will be considered unchanged unless we have been asked to
2326 * detect a change or host requires polling to provide card detection. 2326 * detect a change or host requires polling to provide card detection.
2327 */ 2327 */
2328 if (!host->detect_change && !(host->caps & MMC_CAP_NEEDS_POLL) && 2328 if (!host->detect_change && !(host->caps & MMC_CAP_NEEDS_POLL))
2329 !(host->caps2 & MMC_CAP2_DETECT_ON_ERR))
2330 return ret; 2329 return ret;
2331 2330
2332 host->detect_change = 0; 2331 host->detect_change = 0;
2333 if (!ret) { 2332 if (!ret) {
2334 ret = _mmc_detect_card_removed(host); 2333 ret = _mmc_detect_card_removed(host);
2335 if (ret && (host->caps2 & MMC_CAP2_DETECT_ON_ERR)) { 2334 if (ret && (host->caps & MMC_CAP_NEEDS_POLL)) {
2336 /* 2335 /*
2337 * Schedule a detect work as soon as possible to let a 2336 * Schedule a detect work as soon as possible to let a
2338 * rescan handle the card removal. 2337 * rescan handle the card removal.