mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>
Cc: <R.E.Wolff@BitWizard.nl>
Cc: <support@specialix.co.uk>
Subject: [PATCH 5/9] Char: sx, simplify timer logic
Date: Tue, 31 Oct 2006 01:42:17 +0100 (CET)	[thread overview]
Message-ID: <642139641257723381@karneval.cz> (raw)

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;
 	}

                 reply	other threads:[~2006-10-31  0:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=642139641257723381@karneval.cz \
    --to=jirislaby@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®