All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre Ossman <drzeus-list@drzeus.cx>
To: Russell King <rmk+lkml@arm.linux.org.uk>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] Remove wbsd delayed detection.
Date: Sun, 11 Sep 2005 22:37:06 +0200	[thread overview]
Message-ID: <43249572.7030407@drzeus.cx> (raw)

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

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
---

 drivers/mmc/wbsd.c |   28 +++++-----------------------
 drivers/mmc/wbsd.h |    1 -
 2 files changed, 5 insertions(+), 24 deletions(-)

diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c
--- a/drivers/mmc/wbsd.c
+++ b/drivers/mmc/wbsd.c
@@ -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);

diff --git a/drivers/mmc/wbsd.h b/drivers/mmc/wbsd.h
--- a/drivers/mmc/wbsd.h
+++ b/drivers/mmc/wbsd.h
@@ -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 */
 };

             reply	other threads:[~2005-09-11 20:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-11 20:37 Pierre Ossman [this message]
2005-09-12  7:50 ` [PATCH] Remove unused timer Pierre Ossman
2005-09-12 14:20   ` Pierre Ossman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43249572.7030407@drzeus.cx \
    --to=drzeus-list@drzeus.cx \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.