Skip to contentSkip to conversation

Remove wbsd delayed detection.

PATCH New Pierre Ossman 1 participant 3 messages Sep 11, 2005 – Sep 12, 2005 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove wbsd delayed detection.

Remove the card detection delay framework since it can be done natively in the MMC layer.

---

 drivers/mmc/wbsd.c |   28 +++++-----------------------
 drivers/mmc/wbsd.h |    1 -
 2 files changed, 5 insertions(+), 24 deletions(-)
drivers/mmc/wbsd.c +5 -23
@@ -1112,20 +1112,6 @@ static void wbsd_reset_ignore(unsigned l
 }
 
 /*
- * Helper function for card detection
- */
-static void wbsd_detect_card(unsigned long data)
-{
-	struct wbsd_host *host = (struct wbsd_host*)data;
-
-	BUG_ON(host == NULL);
-
-	DBG("Executing card detection\n");
-
-	mmc_detect_change(host->mmc, 0);
-}
-
-/*
  * Tasklets
  */
 
@@ -1169,14 +1155,15 @@ static void wbsd_tasklet_card(unsigned l
 			DBG("Card inserted\n");
 			host->flags |= WBSD_FCARD_PRESENT;
 
+			spin_unlock(&host->lock);
 			/*
 			 * Delay card detection to allow electrical connections
 			 * to stabilise.
 			 */
-			mod_timer(&host->detect_timer, jiffies + HZ/2);
+			mmc_detect_change(host->mmc, msecs_to_jiffies(500));
 		}
-
-		spin_unlock(&host->lock);
+		else
+			spin_unlock(&host->lock);
 	}
 	else if (host->flags & WBSD_FCARD_PRESENT)
 	{
@@ -1407,12 +1394,8 @@ static int __devinit wbsd_alloc_mmc(stru
 	spin_lock_init(&host->lock);
 
 	/*
-	 * Set up timers
+	 * Set up timer
 	 */
-	init_timer(&host->detect_timer);
-	host->detect_timer.data = (unsigned long)host;
-	host->detect_timer.function = wbsd_detect_card;
-
 	init_timer(&host->ignore_timer);
 	host->ignore_timer.data = (unsigned long)host;
 	host->ignore_timer.function = wbsd_reset_ignore;
@@ -1454,7 +1437,6 @@ static void __devexit wbsd_free_mmc(stru
 	BUG_ON(host == NULL);
 
 	del_timer_sync(&host->ignore_timer);
-	del_timer_sync(&host->detect_timer);
 
 	mmc_free_host(mmc);
 
drivers/mmc/wbsd.h +0 -1
@@ -184,6 +184,5 @@ struct wbsd_host
 	struct tasklet_struct	finish_tasklet;
 	struct tasklet_struct	block_tasklet;
 
-	struct timer_list	detect_timer;	/* Card detection timer */
 	struct timer_list	ignore_timer;	/* Ignore detection timer */
 };
#1 lore raw

PATCH 1/1 Remove unused timer.

Remove timer that was left from earlier cleanup.

---

(obsoletes [PATCH] Remove wbsd delayed detection.)

 drivers/mmc/wbsd.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/mmc/wbsd.h +0 -1
@@ -184,6 +184,5 @@ struct wbsd_host
 	struct tasklet_struct	finish_tasklet;
 	struct tasklet_struct	block_tasklet;
 
-	struct timer_list	detect_timer;	/* Card detection timer */
 	struct timer_list	ignore_timer;	/* Ignore detection timer */
 };
#2 lore raw

Re: [PATCH] Remove unused timer.

Quoted 4 lines · Pierre Ossman

Remove timer that was left from earlier cleanup.

---

Resend with attachment.

Remove unused timer.

Remove timer that was left from earlier cleanup.

---

 drivers/mmc/wbsd.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/mmc/wbsd.h +0 -1
@@ -184,6 +184,5 @@ struct wbsd_host
 	struct tasklet_struct	finish_tasklet;
 	struct tasklet_struct	block_tasklet;
 
-	struct timer_list	detect_timer;	/* Card detection timer */
 	struct timer_list	ignore_timer;	/* Ignore detection timer */
 };