public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Char: isicom, use completion
@ 2006-10-22  0:54 Jiri Slaby
  0 siblings, 0 replies; only message in thread
From: Jiri Slaby @ 2006-10-22  0:54 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

isicom, use completion

use wait_for_completion+complete instead of variables+msleep hack.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit 12be27655354f888150bbb720614dfba48cecdaf
tree a41af90a51a6de23bbae8ee7109a33a7fef23154
parent e6ef63223d0b6c4a72f815b8a42584d346980c82
author Jiri Slaby <jirislaby@gmail.com> Sat, 21 Oct 2006 21:50:40 +0200
committer Jiri Slaby <jirislaby@gmail.com> Sat, 21 Oct 2006 21:50:40 +0200

 drivers/char/isicom.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index db57da6..a8cfdf5 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -172,6 +172,7 @@ static struct pci_driver isicom_driver =
 static int prev_card = 3;	/*	start servicing isi_card[0]	*/
 static struct tty_driver *isicom_normal;
 
+static DECLARE_COMPLETION(isi_timerdone);
 static struct timer_list tx;
 static char re_schedule = 1;
 
@@ -514,7 +515,7 @@ static void isicom_tx(unsigned long _dat
 	/*	schedule another tx for hopefully in about 10ms	*/
 sched_again:
 	if (!re_schedule) {
-		re_schedule = 2;
+		complete(&isi_timerdone);
  		return;
 	}
 
@@ -1923,12 +1924,9 @@ error:
 
 static void __exit isicom_exit(void)
 {
-	unsigned int index = 0;
-
 	re_schedule = 0;
 
-	while (re_schedule != 2 && index++ < 100)
-		msleep(10);
+	wait_for_completion_timeout(&isi_timerdone, HZ);
 
 	pci_unregister_driver(&isicom_driver);
 	tty_unregister_driver(isicom_normal);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-22  0:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-22  0:54 [PATCH 1/3] Char: isicom, use completion Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox