* [PATCH 5/9] Char: sx, simplify timer logic
@ 2006-10-31 0:42 Jiri Slaby
0 siblings, 0 replies; only message in thread
From: Jiri Slaby @ 2006-10-31 0:42 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, R.E.Wolff, support
sx, simplify timer logic
Use kernel helpers for changing timer internals.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
commit ff54cb9cb0f690ad9414bc8c800b8fdfb38199a2
tree e3af70b31ec8df40137157f21e0e7641b4e3bf15
parent 10fd13e67b848584d1553b524d2e925ad60a1b4f
author Jiri Slaby <jirislaby@gmail.com> Tue, 31 Oct 2006 00:43:49 +0100
committer Jiri Slaby <jirislaby@gmail.com> Tue, 31 Oct 2006 00:43:49 +0100
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 fe5fabb..3e71bf8 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -1304,10 +1304,7 @@ static void sx_pollfunc(unsigned long da
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();
}
@@ -2006,14 +2003,10 @@ static int sx_init_board(struct sx_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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-10-31 0:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-31 0:42 [PATCH 5/9] Char: sx, simplify timer logic Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®