summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2006-04-10 22:55:03 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 06:18:49 -0700
commitec81b5e6294088dc4738d0e8c2316c0dc081215c (patch)
treec78b16feffafeed5ffa77da2d5afb5a6552a2a25 /drivers
parentbd0d6ef944f992c584152dbfca99188107bf2f8d (diff)
downloadop-kernel-dev-ec81b5e6294088dc4738d0e8c2316c0dc081215c.zip
op-kernel-dev-ec81b5e6294088dc4738d0e8c2316c0dc081215c.tar.gz
[PATCH] isdn4linux: Siemens Gigaset drivers: timer usage
With Hansjoerg Lipp <hjlipp@web.de> Correct timer usage in the Gigaset drivers to take advantage of the existing setup_timer() function, and use milliseconds as unit. Signed-off-by: Hansjoerg Lipp <hjlipp@web.de> Signed-off-by: Tilman Schmidt <tilman@imap.cc> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/isdn/gigaset/common.c7
-rw-r--r--drivers/isdn/gigaset/gigaset.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 1163d31..a607837 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -219,7 +219,7 @@ static void timer_tick(unsigned long data)
timeout = 1;
if (atomic_read(&cs->running)) {
- mod_timer(&cs->timer, jiffies + GIG_TICK);
+ mod_timer(&cs->timer, jiffies + msecs_to_jiffies(GIG_TICK));
if (timeout) {
dbg(DEBUG_CMD, "scheduling timeout");
tasklet_schedule(&cs->event_tasklet);
@@ -685,9 +685,8 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
gigaset_if_init(cs);
atomic_set(&cs->running, 1);
- cs->timer.data = (unsigned long) cs;
- cs->timer.function = timer_tick;
- cs->timer.expires = jiffies + GIG_TICK;
+ setup_timer(&cs->timer, timer_tick, (unsigned long) cs);
+ cs->timer.expires = jiffies + msecs_to_jiffies(GIG_TICK);
/* FIXME: can jiffies increase too much until the timer is added?
* Same problem(?) with mod_timer() in timer_tick(). */
add_timer(&cs->timer);
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h
index d34f0023..bc5a629 100644
--- a/drivers/isdn/gigaset/gigaset.h
+++ b/drivers/isdn/gigaset/gigaset.h
@@ -58,7 +58,7 @@
#define MAX_TIMER_INDEX 1000
#define MAX_SEQ_INDEX 1000
-#define GIG_TICK (HZ / 10)
+#define GIG_TICK 100 /* in milliseconds */
/* timeout values (unit: 1 sec) */
#define INIT_TIMEOUT 1
OpenPOWER on IntegriCloud