提交 c9594643 编写于 作者: J Jiri Slaby 提交者: Linus Torvalds

[PATCH] Char: sx, simplify timer logic

Use kernel helpers for changing timer internals.
Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 15b611f6
...@@ -1353,10 +1353,7 @@ static void sx_pollfunc(unsigned long data) ...@@ -1353,10 +1353,7 @@ static void sx_pollfunc(unsigned long data)
sx_interrupt(0, board); sx_interrupt(0, board);
init_timer(&board->timer); mod_timer(&board->timer, jiffies + sx_poll);
board->timer.expires = jiffies + sx_poll;
add_timer(&board->timer);
func_exit(); func_exit();
} }
...@@ -2134,14 +2131,10 @@ static int sx_init_board(struct sx_board *board) ...@@ -2134,14 +2131,10 @@ static int sx_init_board(struct sx_board *board)
/* The timer should be initialized anyway: That way we can /* The timer should be initialized anyway: That way we can
safely del_timer it when the module is unloaded. */ 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) { if (board->poll)
board->timer.data = (unsigned long)board; mod_timer(&board->timer, jiffies + board->poll);
board->timer.function = sx_pollfunc;
board->timer.expires = jiffies + board->poll;
add_timer(&board->timer);
}
} else { } else {
board->irq = 0; board->irq = 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册