diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2006-12-08 05:39:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:28:58 -0500 |
commit | c9594643c095da0a0ad4d5f0a1ff357a84e91524 (patch) | |
tree | 3479c8dda73feb613371204b310fe39f110dd4e0 /drivers/char/sx.c | |
parent | 15b611f63f0fb8709a5fae498c2d688b5d05edc9 (diff) |
[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>
Diffstat (limited to 'drivers/char/sx.c')
-rw-r--r-- | drivers/char/sx.c | 15 |
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) | |||
1353 | 1353 | ||
1354 | sx_interrupt(0, board); | 1354 | sx_interrupt(0, board); |
1355 | 1355 | ||
1356 | init_timer(&board->timer); | 1356 | mod_timer(&board->timer, jiffies + sx_poll); |
1357 | |||
1358 | board->timer.expires = jiffies + sx_poll; | ||
1359 | add_timer(&board->timer); | ||
1360 | func_exit(); | 1357 | func_exit(); |
1361 | } | 1358 | } |
1362 | 1359 | ||
@@ -2134,14 +2131,10 @@ static int sx_init_board(struct sx_board *board) | |||
2134 | 2131 | ||
2135 | /* The timer should be initialized anyway: That way we can | 2132 | /* The timer should be initialized anyway: That way we can |
2136 | safely del_timer it when the module is unloaded. */ | 2133 | safely del_timer it when the module is unloaded. */ |
2137 | init_timer(&board->timer); | 2134 | setup_timer(&board->timer, sx_pollfunc, (unsigned long)board); |
2138 | 2135 | ||
2139 | if (board->poll) { | 2136 | if (board->poll) |
2140 | board->timer.data = (unsigned long)board; | 2137 | mod_timer(&board->timer, jiffies + board->poll); |
2141 | board->timer.function = sx_pollfunc; | ||
2142 | board->timer.expires = jiffies + board->poll; | ||
2143 | add_timer(&board->timer); | ||
2144 | } | ||
2145 | } else { | 2138 | } else { |
2146 | board->irq = 0; | 2139 | board->irq = 0; |
2147 | } | 2140 | } |