summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2006-12-08 02:39:05 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 08:28:58 -0800
commitc9594643c095da0a0ad4d5f0a1ff357a84e91524 (patch)
tree3479c8dda73feb613371204b310fe39f110dd4e0
parent15b611f63f0fb8709a5fae498c2d688b5d05edc9 (diff)
downloadlinux-c9594643c095da0a0ad4d5f0a1ff357a84e91524.tar.gz
linux-c9594643c095da0a0ad4d5f0a1ff357a84e91524.tar.bz2
linux-c9594643c095da0a0ad4d5f0a1ff357a84e91524.zip
[PATCH] Char: sx, simplify timer logic
Use kernel helpers for changing timer internals. 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>
-rw-r--r--drivers/char/sx.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 401ebab26018..0122b2d93312 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -1353,10 +1353,7 @@ static void sx_pollfunc(unsigned long data)
sx_interrupt(0, board);
- init_timer(&board->timer);
-
- board->timer.expires = jiffies + sx_poll;
- add_timer(&board->timer);
+ mod_timer(&board->timer, jiffies + sx_poll);
func_exit();
}
@@ -2134,14 +2131,10 @@ static int sx_init_board(struct sx_board *board)
/* The timer should be initialized anyway: That way we can
safely del_timer it when the module is unloaded. */
- init_timer(&board->timer);
+ setup_timer(&board->timer, sx_pollfunc, (unsigned long)board);
- if (board->poll) {
- board->timer.data = (unsigned long)board;
- board->timer.function = sx_pollfunc;
- board->timer.expires = jiffies + board->poll;
- add_timer(&board->timer);
- }
+ if (board->poll)
+ mod_timer(&board->timer, jiffies + board->poll);
} else {
board->irq = 0;
}