aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/isicom.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2006-12-08 05:38:55 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:58 -0500
commit906cdecbedae93e3f63651000f620acddf4debe9 (patch)
treea8efeeb74489f6b06902f5cf98ec6c9abbf4e563 /drivers/char/isicom.c
parentf0671378426d9768bf20d5e0f8389374dcdc2abf (diff)
[PATCH] Char: isicom, use completion
Use wait_for_completion+complete instead of variables+msleep hack. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/isicom.c')
-rw-r--r--drivers/char/isicom.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 783a7ec0a8e..734fe39a6ac 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -172,6 +172,7 @@ static struct pci_driver isicom_driver = {
172static int prev_card = 3; /* start servicing isi_card[0] */ 172static int prev_card = 3; /* start servicing isi_card[0] */
173static struct tty_driver *isicom_normal; 173static struct tty_driver *isicom_normal;
174 174
175static DECLARE_COMPLETION(isi_timerdone);
175static struct timer_list tx; 176static struct timer_list tx;
176static char re_schedule = 1; 177static char re_schedule = 1;
177 178
@@ -514,7 +515,7 @@ static void isicom_tx(unsigned long _data)
514 /* schedule another tx for hopefully in about 10ms */ 515 /* schedule another tx for hopefully in about 10ms */
515sched_again: 516sched_again:
516 if (!re_schedule) { 517 if (!re_schedule) {
517 re_schedule = 2; 518 complete(&isi_timerdone);
518 return; 519 return;
519 } 520 }
520 521
@@ -1924,12 +1925,9 @@ error:
1924 1925
1925static void __exit isicom_exit(void) 1926static void __exit isicom_exit(void)
1926{ 1927{
1927 unsigned int index = 0;
1928
1929 re_schedule = 0; 1928 re_schedule = 0;
1930 1929
1931 while (re_schedule != 2 && index++ < 100) 1930 wait_for_completion_timeout(&isi_timerdone, HZ);
1932 msleep(10);
1933 1931
1934 pci_unregister_driver(&isicom_driver); 1932 pci_unregister_driver(&isicom_driver);
1935 tty_unregister_driver(isicom_normal); 1933 tty_unregister_driver(isicom_normal);