diff options
author | Tilman Schmidt <tilman@imap.cc> | 2006-04-11 01:55:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:18:49 -0400 |
commit | ec81b5e6294088dc4738d0e8c2316c0dc081215c (patch) | |
tree | c78b16feffafeed5ffa77da2d5afb5a6552a2a25 /drivers/isdn/gigaset | |
parent | bd0d6ef944f992c584152dbfca99188107bf2f8d (diff) |
[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/isdn/gigaset')
-rw-r--r-- | drivers/isdn/gigaset/common.c | 7 | ||||
-rw-r--r-- | drivers/isdn/gigaset/gigaset.h | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index 1163d316f58c..a607837b9f6c 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c | |||
@@ -219,7 +219,7 @@ static void timer_tick(unsigned long data) | |||
219 | timeout = 1; | 219 | timeout = 1; |
220 | 220 | ||
221 | if (atomic_read(&cs->running)) { | 221 | if (atomic_read(&cs->running)) { |
222 | mod_timer(&cs->timer, jiffies + GIG_TICK); | 222 | mod_timer(&cs->timer, jiffies + msecs_to_jiffies(GIG_TICK)); |
223 | if (timeout) { | 223 | if (timeout) { |
224 | dbg(DEBUG_CMD, "scheduling timeout"); | 224 | dbg(DEBUG_CMD, "scheduling timeout"); |
225 | tasklet_schedule(&cs->event_tasklet); | 225 | tasklet_schedule(&cs->event_tasklet); |
@@ -685,9 +685,8 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, | |||
685 | gigaset_if_init(cs); | 685 | gigaset_if_init(cs); |
686 | 686 | ||
687 | atomic_set(&cs->running, 1); | 687 | atomic_set(&cs->running, 1); |
688 | cs->timer.data = (unsigned long) cs; | 688 | setup_timer(&cs->timer, timer_tick, (unsigned long) cs); |
689 | cs->timer.function = timer_tick; | 689 | cs->timer.expires = jiffies + msecs_to_jiffies(GIG_TICK); |
690 | cs->timer.expires = jiffies + GIG_TICK; | ||
691 | /* FIXME: can jiffies increase too much until the timer is added? | 690 | /* FIXME: can jiffies increase too much until the timer is added? |
692 | * Same problem(?) with mod_timer() in timer_tick(). */ | 691 | * Same problem(?) with mod_timer() in timer_tick(). */ |
693 | add_timer(&cs->timer); | 692 | add_timer(&cs->timer); |
diff --git a/drivers/isdn/gigaset/gigaset.h b/drivers/isdn/gigaset/gigaset.h index d34f0023ac74..bc5a6294f0c0 100644 --- a/drivers/isdn/gigaset/gigaset.h +++ b/drivers/isdn/gigaset/gigaset.h | |||
@@ -58,7 +58,7 @@ | |||
58 | #define MAX_TIMER_INDEX 1000 | 58 | #define MAX_TIMER_INDEX 1000 |
59 | #define MAX_SEQ_INDEX 1000 | 59 | #define MAX_SEQ_INDEX 1000 |
60 | 60 | ||
61 | #define GIG_TICK (HZ / 10) | 61 | #define GIG_TICK 100 /* in milliseconds */ |
62 | 62 | ||
63 | /* timeout values (unit: 1 sec) */ | 63 | /* timeout values (unit: 1 sec) */ |
64 | #define INIT_TIMEOUT 1 | 64 | #define INIT_TIMEOUT 1 |