The wbsd driver's card detection routing is a bit of a mess. This
patch cleans up the routine and makes it a bit more comprihensible.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
{
struct wbsd_host* host = (struct wbsd_host*)param;
u8 csr;
{
struct wbsd_host* host = (struct wbsd_host*)param;
u8 csr;
DBG("Card inserted\n");
host->flags |= WBSD_FCARD_PRESENT;
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));
- else
- spin_unlock(&host->lock);
}
else if (host->flags & WBSD_FCARD_PRESENT)
{
}
else if (host->flags & WBSD_FCARD_PRESENT)
{
tasklet_schedule(&host->finish_tasklet);
}
tasklet_schedule(&host->finish_tasklet);
}
- /*
- * Unlock first since we might get a call back.
- */
- spin_unlock(&host->lock);
-
- mmc_detect_change(host->mmc, 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)
}
static void wbsd_tasklet_fifo(unsigned long param)