From 5ee1d3757a08e53325cf3d794383fb1f8fe9affd Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 12 Sep 2005 20:36:19 +0100 Subject: [PATCH] --- yaml --- r: 8690 b: refs/heads/master c: 210ce2a7504e429b7ccc191b1efba4c772c4d8b6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/mmc/wbsd.c | 29 ++++++++++++----------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index 06da73cc1cbf..fa17c554eec5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e062c8ae85df633f2ecaa5a5af0d9922ced5e074 +refs/heads/master: 210ce2a7504e429b7ccc191b1efba4c772c4d8b6 diff --git a/trunk/drivers/mmc/wbsd.c b/trunk/drivers/mmc/wbsd.c index 46e5f9a17a23..3cbca7cbea80 100644 --- a/trunk/drivers/mmc/wbsd.c +++ b/trunk/drivers/mmc/wbsd.c @@ -1136,6 +1136,7 @@ static void wbsd_tasklet_card(unsigned long param) { struct wbsd_host* host = (struct wbsd_host*)param; u8 csr; + int delay = -1; spin_lock(&host->lock); @@ -1155,16 +1156,8 @@ static void wbsd_tasklet_card(unsigned long param) DBG("Card inserted\n"); host->flags |= WBSD_FCARD_PRESENT; - spin_unlock(&host->lock); - - /* - * Delay card detection to allow electrical connections - * to stabilise. - */ - mmc_detect_change(host->mmc, msecs_to_jiffies(500)); + delay = 500; } - else - spin_unlock(&host->lock); } else if (host->flags & WBSD_FCARD_PRESENT) { @@ -1181,15 +1174,17 @@ static void wbsd_tasklet_card(unsigned long param) tasklet_schedule(&host->finish_tasklet); } - /* - * Unlock first since we might get a call back. - */ - spin_unlock(&host->lock); - - mmc_detect_change(host->mmc, 0); + delay = 0; } - else - spin_unlock(&host->lock); + + /* + * Unlock first since we might get a call back. + */ + + spin_unlock(&host->lock); + + if (delay != -1) + mmc_detect_change(host->mmc, msecs_to_jiffies(delay)); } static void wbsd_tasklet_fifo(unsigned long param)