From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/5] Char: cyclades, timer cleanup
Date: Wed, 4 Apr 2007 23:45:27 +0200 (CEST) [thread overview]
Message-ID: <7793186113082823019@karneval.cz> (raw)
In-Reply-To: <16309194841640222796@karneval.cz>
cyclades, timer cleanup
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
commit d4e20e52c6084cff971d5b696c6eeac5ca2f9f48
tree 6372590725beebef60015ece7f910ce208cd5d0e
parent b0deeb148ea3d68519e313a08aad142aa44b0d41
author Jiri Slaby <jirislaby@gmail.com> Mon, 26 Mar 2007 16:20:08 +0200
committer Jiri Slaby <jirislaby@gmail.com> Tue, 27 Mar 2007 14:45:37 +0200
drivers/char/cyclades.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index fc73537..0e530cb 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -851,7 +851,6 @@ static void cyz_poll(unsigned long);
/* The Cyclades-Z polling cycle is defined by this variable */
static long cyz_polling_cycle = CZ_DEF_POLL;
-static int cyz_timeron = 0;
static DEFINE_TIMER(cyz_timerlist, cyz_poll, 0, 0);
#else /* CONFIG_CYZ_INTR */
@@ -1906,9 +1905,9 @@ static void cyz_poll(unsigned long arg)
static volatile struct BOARD_CTRL *board_ctrl;
static volatile struct CH_CTRL *ch_ctrl;
static volatile struct BUF_CTRL *buf_ctrl;
+ unsigned long expires = jiffies + HZ;
int card, port;
- cyz_timerlist.expires = jiffies + (HZ);
for (card = 0; card < NR_CARDS; card++) {
cinfo = &cy_card[card];
@@ -1942,9 +1941,9 @@ static void cyz_poll(unsigned long arg)
cyz_handle_tx(info, ch_ctrl, buf_ctrl);
}
/* poll every 'cyz_polling_cycle' period */
- cyz_timerlist.expires = jiffies + cyz_polling_cycle;
+ expires = jiffies + cyz_polling_cycle;
}
- add_timer(&cyz_timerlist);
+ mod_timer(&cyz_timerlist, expires);
} /* cyz_poll */
#endif /* CONFIG_CYZ_INTR */
@@ -5504,10 +5503,8 @@ static int __init cy_init(void)
}
#ifndef CONFIG_CYZ_INTR
- if (number_z_boards && !cyz_timeron) {
- cyz_timeron++;
- cyz_timerlist.expires = jiffies + 1;
- add_timer(&cyz_timerlist);
+ if (number_z_boards) {
+ mod_timer(&cyz_timerlist, jiffies + 1);
#ifdef CY_PCI_DEBUG
printk("Cyclades-Z polling initialized\n");
#endif
@@ -5523,10 +5520,7 @@ static void __exit cy_cleanup_module(void)
int i, e1;
#ifndef CONFIG_CYZ_INTR
- if (cyz_timeron){
- cyz_timeron = 0;
- del_timer(&cyz_timerlist);
- }
+ del_timer_sync(&cyz_timerlist);
#endif /* CONFIG_CYZ_INTR */
if ((e1 = tty_unregister_driver(cy_serial_driver)))
next prev parent reply other threads:[~2007-04-04 21:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-04 21:44 [PATCH 1/5] Char: cyclades, remove PAUSE Jiri Slaby
2007-04-04 21:45 ` [PATCH 2/5] Char: cyclades, cy_readX/writeX cleanup Jiri Slaby
2007-04-04 21:45 ` Jiri Slaby [this message]
2007-04-04 21:45 ` [PATCH 4/5] Char: cyclades, remove volatiles Jiri Slaby
2007-04-07 0:14 ` Andrew Morton
2007-04-07 7:28 ` Jiri Slaby
2007-04-09 14:20 ` John Stoffel
2007-04-10 11:43 ` Jiri Slaby
2007-04-10 15:03 ` John Stoffel
2007-04-04 21:45 ` [PATCH 5/5] Char: cyclades, remove useless casts Jiri Slaby
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=7793186113082823019@karneval.cz \
--to=jirislaby@gmail.com \
--cc=akpm@linux-foundation.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