diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-02-12 03:52:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:30 -0500 |
commit | 40565f1962c5be9b9e285e05af01ab7771534868 (patch) | |
tree | ae84097778a8adfc5a9aad8a5428fe803d54346a /drivers/char/specialix.c | |
parent | d096f3e9898d469493fc0afe88d7285c4bdc3ce2 (diff) |
[PATCH] Char: timers cleanup
- Use timer macros to set function and data members and to modify
expiration time.
- Use DEFINE_TIMER for global timers and do not init them at run-time in
these cases.
- del_timer_sync is common in most cases -- we want to wait for timer
function if it's still running.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Dave Airlie <airlied@linux.ie>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Kylene Jo Hall <kjhall@us.ibm.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Acked-by: Dmitry Torokhov <dtor@mail.ru> (Input bits)
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/specialix.c')
-rw-r--r-- | drivers/char/specialix.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index f1688fe81ac7..baf7234b6e66 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c | |||
@@ -461,8 +461,7 @@ void missed_irq (unsigned long data) | |||
461 | sx_interrupt (((struct specialix_board *)data)->irq, | 461 | sx_interrupt (((struct specialix_board *)data)->irq, |
462 | (void*)data); | 462 | (void*)data); |
463 | } | 463 | } |
464 | missed_irq_timer.expires = jiffies + sx_poll; | 464 | mod_timer(&missed_irq_timer, jiffies + sx_poll); |
465 | add_timer (&missed_irq_timer); | ||
466 | } | 465 | } |
467 | #endif | 466 | #endif |
468 | 467 | ||
@@ -597,11 +596,8 @@ static int sx_probe(struct specialix_board *bp) | |||
597 | dprintk (SX_DEBUG_INIT, " GFCR = 0x%02x\n", sx_in_off(bp, CD186x_GFRCR) ); | 596 | dprintk (SX_DEBUG_INIT, " GFCR = 0x%02x\n", sx_in_off(bp, CD186x_GFRCR) ); |
598 | 597 | ||
599 | #ifdef SPECIALIX_TIMER | 598 | #ifdef SPECIALIX_TIMER |
600 | init_timer (&missed_irq_timer); | 599 | setup_timer(&missed_irq_timer, missed_irq, (unsigned long)bp); |
601 | missed_irq_timer.function = missed_irq; | 600 | mod_timer(&missed_irq_timer, jiffies + sx_poll); |
602 | missed_irq_timer.data = (unsigned long) bp; | ||
603 | missed_irq_timer.expires = jiffies + sx_poll; | ||
604 | add_timer (&missed_irq_timer); | ||
605 | #endif | 601 | #endif |
606 | 602 | ||
607 | printk(KERN_INFO"sx%d: specialix IO8+ board detected at 0x%03x, IRQ %d, CD%d Rev. %c.\n", | 603 | printk(KERN_INFO"sx%d: specialix IO8+ board detected at 0x%03x, IRQ %d, CD%d Rev. %c.\n", |
@@ -2559,7 +2555,7 @@ static void __exit specialix_exit_module(void) | |||
2559 | if (sx_board[i].flags & SX_BOARD_PRESENT) | 2555 | if (sx_board[i].flags & SX_BOARD_PRESENT) |
2560 | sx_release_io_range(&sx_board[i]); | 2556 | sx_release_io_range(&sx_board[i]); |
2561 | #ifdef SPECIALIX_TIMER | 2557 | #ifdef SPECIALIX_TIMER |
2562 | del_timer (&missed_irq_timer); | 2558 | del_timer_sync(&missed_irq_timer); |
2563 | #endif | 2559 | #endif |
2564 | 2560 | ||
2565 | func_exit(); | 2561 | func_exit(); |