Messages in this thread Patch in this message | | | Date | Tue, 4 Apr 2006 02:00:25 +0200 | From | Hansjoerg Lipp <> | Subject | [PATCH 3/13] isdn4linux: Siemens Gigaset drivers - timer usage |
| |
From: Tilman Schmidt <tilman@imap.cc>, Hansjoerg Lipp <hjlipp@web.de>
This patch corrects timer usage in the Gigaset drivers to take advantage of the existing setup_timer() function, and use milliseconds as unit. Please merge.
Signed-off-by: Hansjoerg Lipp <hjlipp@web.de> Signed-off-by: Tilman Schmidt <tilman@imap.cc> ---
drivers/isdn/gigaset/common.c | 7 +++---- drivers/isdn/gigaset/gigaset.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-)
--- linux-2.6.16-gig-kconfig/drivers/isdn/gigaset/gigaset.h 2006-04-02 18:37:04.000000000 +0200 +++ linux-2.6.16-gig-timer/drivers/isdn/gigaset/gigaset.h 2006-04-02 18:38:09.000000000 +0200 @@ -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 --- linux-2.6.16-gig-kconfig/drivers/isdn/gigaset/common.c 2006-04-02 18:37:04.000000000 +0200 +++ linux-2.6.16-gig-timer/drivers/isdn/gigaset/common.c 2006-04-02 18:38:09.000000000 +0200 @@ -219,7 +219,7 @@ static void timer_tick(unsigned long dat 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_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); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |