Commit 906cdecb authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

[PATCH] Char: isicom, use completion

Use wait_for_completion+complete instead of variables+msleep hack.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f0671378
...@@ -172,6 +172,7 @@ static struct pci_driver isicom_driver = { ...@@ -172,6 +172,7 @@ static struct pci_driver isicom_driver = {
static int prev_card = 3; /* start servicing isi_card[0] */ static int prev_card = 3; /* start servicing isi_card[0] */
static struct tty_driver *isicom_normal; static struct tty_driver *isicom_normal;
static DECLARE_COMPLETION(isi_timerdone);
static struct timer_list tx; static struct timer_list tx;
static char re_schedule = 1; static char re_schedule = 1;
...@@ -514,7 +515,7 @@ static void isicom_tx(unsigned long _data) ...@@ -514,7 +515,7 @@ static void isicom_tx(unsigned long _data)
/* schedule another tx for hopefully in about 10ms */ /* schedule another tx for hopefully in about 10ms */
sched_again: sched_again:
if (!re_schedule) { if (!re_schedule) {
re_schedule = 2; complete(&isi_timerdone);
return; return;
} }
...@@ -1924,12 +1925,9 @@ static int __init isicom_init(void) ...@@ -1924,12 +1925,9 @@ static int __init isicom_init(void)
static void __exit isicom_exit(void) static void __exit isicom_exit(void)
{ {
unsigned int index = 0;
re_schedule = 0; re_schedule = 0;
while (re_schedule != 2 && index++ < 100) wait_for_completion_timeout(&isi_timerdone, HZ);
msleep(10);
pci_unregister_driver(&isicom_driver); pci_unregister_driver(&isicom_driver);
tty_unregister_driver(isicom_normal); tty_unregister_driver(isicom_normal);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment