diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2006-12-08 02:38:55 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 08:28:58 -0800 |
commit | 906cdecbedae93e3f63651000f620acddf4debe9 (patch) | |
tree | a8efeeb74489f6b06902f5cf98ec6c9abbf4e563 /drivers/char/isicom.c | |
parent | f0671378426d9768bf20d5e0f8389374dcdc2abf (diff) | |
download | kernel-crypto-906cdecbedae93e3f63651000f620acddf4debe9.tar.gz kernel-crypto-906cdecbedae93e3f63651000f620acddf4debe9.tar.xz kernel-crypto-906cdecbedae93e3f63651000f620acddf4debe9.zip |
[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.c | 8 |
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 = { 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 _data) /* schedule another tx for hopefully in about 10ms */ sched_again: if (!re_schedule) { - re_schedule = 2; + complete(&isi_timerdone); return; } @@ -1924,12 +1925,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); |