diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-01-07 11:33:33 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-01-07 11:33:33 -0200 |
commit | f14679d82c224a54c3cfd5ae4473a45cdbce3592 (patch) | |
tree | 70360a4ced06dce768bbf46c0da804d2f05cdb93 /linux/drivers/media/video/bt8xx/bttv-input.c | |
parent | 995d32a1dcb18eed5effb48d652953f093137827 (diff) | |
download | mediapointer-dvb-s2-f14679d82c224a54c3cfd5ae4473a45cdbce3592.tar.gz mediapointer-dvb-s2-f14679d82c224a54c3cfd5ae4473a45cdbce3592.tar.bz2 |
From: Dmitry Torokhov <dtor@insightbb.com>
Subject: V4L: bttv - switch to using msecs_to_jiffies()
Date: Tue, 2 Jan 2007 01:29:48 -0500
V4L: bttv - switch to using msecs_to_jiffies()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
PS.: Part of the changes at the original patch were already applied by
a previous patch.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/bt8xx/bttv-input.c')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-input.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-input.c b/linux/drivers/media/video/bt8xx/bttv-input.c index a88b7dd10..d25b4c912 100644 --- a/linux/drivers/media/video/bt8xx/bttv-input.c +++ b/linux/drivers/media/video/bt8xx/bttv-input.c @@ -88,11 +88,9 @@ static void bttv_input_timer(unsigned long data) { struct bttv *btv = (struct bttv*)data; struct card_ir *ir = btv->remote; - unsigned long timeout; ir_handle_key(btv); - timeout = jiffies + (ir->polling * HZ / 1000); - mod_timer(&ir->timer, timeout); + mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling)); } /* ---------------------------------------------------------------*/ @@ -103,7 +101,7 @@ static int bttv_rc5_irq(struct bttv *btv) struct timeval tv; u32 gpio; u32 gap; - unsigned long current_jiffies, timeout; + unsigned long current_jiffies; /* read gpio port */ gpio = bttv_gpio_read(&btv->c); @@ -140,8 +138,8 @@ static int bttv_rc5_irq(struct bttv *btv) ir->base_time = tv; ir->last_bit = 0; - timeout = current_jiffies + (500 + 30 * HZ) / 1000; - mod_timer(&ir->timer_end, timeout); + mod_timer(&ir->timer_end, + current_jiffies + msecs_to_jiffies(30)); } /* toggle GPIO pin 4 to reset the irq */ @@ -155,9 +153,7 @@ static int bttv_rc5_irq(struct bttv *btv) static void bttv_ir_start(struct bttv *btv, struct card_ir *ir) { if (ir->polling) { - init_timer(&ir->timer); - ir->timer.function = bttv_input_timer; - ir->timer.data = (unsigned long)btv; + setup_timer(&ir->timer, bttv_input_timer, (unsigned long)btv); ir->timer.expires = jiffies + HZ; add_timer(&ir->timer); } else if (ir->rc5_gpio) { |