aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/cyclades.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-05-08 03:35:48 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:22 -0400
commitb70509066cba24067757f1422c899c43e433429d (patch)
tree8d633b496bd6acf2c8c2bb27a36ad1c376bad9a5 /drivers/char/cyclades.c
parentdb05c3b1ddaa06e658548f3d99e31a188b0b3bcc (diff)
Char: cyclades, timer cleanup
cyclades, timer cleanup Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/cyclades.c')
-rw-r--r--drivers/char/cyclades.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 9bf0fb2fa0d4..a035fb07acda 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -851,7 +851,6 @@ static void cyz_poll(unsigned long);
851/* The Cyclades-Z polling cycle is defined by this variable */ 851/* The Cyclades-Z polling cycle is defined by this variable */
852static long cyz_polling_cycle = CZ_DEF_POLL; 852static long cyz_polling_cycle = CZ_DEF_POLL;
853 853
854static int cyz_timeron = 0;
855static DEFINE_TIMER(cyz_timerlist, cyz_poll, 0, 0); 854static DEFINE_TIMER(cyz_timerlist, cyz_poll, 0, 0);
856 855
857#else /* CONFIG_CYZ_INTR */ 856#else /* CONFIG_CYZ_INTR */
@@ -1906,9 +1905,9 @@ static void cyz_poll(unsigned long arg)
1906 static volatile struct BOARD_CTRL *board_ctrl; 1905 static volatile struct BOARD_CTRL *board_ctrl;
1907 static volatile struct CH_CTRL *ch_ctrl; 1906 static volatile struct CH_CTRL *ch_ctrl;
1908 static volatile struct BUF_CTRL *buf_ctrl; 1907 static volatile struct BUF_CTRL *buf_ctrl;
1908 unsigned long expires = jiffies + HZ;
1909 int card, port; 1909 int card, port;
1910 1910
1911 cyz_timerlist.expires = jiffies + (HZ);
1912 for (card = 0; card < NR_CARDS; card++) { 1911 for (card = 0; card < NR_CARDS; card++) {
1913 cinfo = &cy_card[card]; 1912 cinfo = &cy_card[card];
1914 1913
@@ -1942,9 +1941,9 @@ static void cyz_poll(unsigned long arg)
1942 cyz_handle_tx(info, ch_ctrl, buf_ctrl); 1941 cyz_handle_tx(info, ch_ctrl, buf_ctrl);
1943 } 1942 }
1944 /* poll every 'cyz_polling_cycle' period */ 1943 /* poll every 'cyz_polling_cycle' period */
1945 cyz_timerlist.expires = jiffies + cyz_polling_cycle; 1944 expires = jiffies + cyz_polling_cycle;
1946 } 1945 }
1947 add_timer(&cyz_timerlist); 1946 mod_timer(&cyz_timerlist, expires);
1948} /* cyz_poll */ 1947} /* cyz_poll */
1949 1948
1950#endif /* CONFIG_CYZ_INTR */ 1949#endif /* CONFIG_CYZ_INTR */
@@ -5504,10 +5503,8 @@ static int __init cy_init(void)
5504 } 5503 }
5505 5504
5506#ifndef CONFIG_CYZ_INTR 5505#ifndef CONFIG_CYZ_INTR
5507 if (number_z_boards && !cyz_timeron) { 5506 if (number_z_boards) {
5508 cyz_timeron++; 5507 mod_timer(&cyz_timerlist, jiffies + 1);
5509 cyz_timerlist.expires = jiffies + 1;
5510 add_timer(&cyz_timerlist);
5511#ifdef CY_PCI_DEBUG 5508#ifdef CY_PCI_DEBUG
5512 printk("Cyclades-Z polling initialized\n"); 5509 printk("Cyclades-Z polling initialized\n");
5513#endif 5510#endif
@@ -5523,10 +5520,7 @@ static void __exit cy_cleanup_module(void)
5523 int i, e1; 5520 int i, e1;
5524 5521
5525#ifndef CONFIG_CYZ_INTR 5522#ifndef CONFIG_CYZ_INTR
5526 if (cyz_timeron){ 5523 del_timer_sync(&cyz_timerlist);
5527 cyz_timeron = 0;
5528 del_timer(&cyz_timerlist);
5529 }
5530#endif /* CONFIG_CYZ_INTR */ 5524#endif /* CONFIG_CYZ_INTR */
5531 5525
5532 if ((e1 = tty_unregister_driver(cy_serial_driver))) 5526 if ((e1 = tty_unregister_driver(cy_serial_driver)))