Commit c1904956 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Mauro Carvalho Chehab

V4L/DVB (5025): Cleanup: switch to using msecs_to_jiffies() on bttv

PS.: Part of the changes at the original patch were removed due to the changes
done at commit 52c14e794f6ce345343a6b8fc98ea4e0ba2dfce4
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent cededbfc
...@@ -87,11 +87,9 @@ static void bttv_input_timer(unsigned long data) ...@@ -87,11 +87,9 @@ static void bttv_input_timer(unsigned long data)
{ {
struct bttv *btv = (struct bttv*)data; struct bttv *btv = (struct bttv*)data;
struct card_ir *ir = btv->remote; struct card_ir *ir = btv->remote;
unsigned long timeout;
ir_handle_key(btv); ir_handle_key(btv);
timeout = jiffies + (ir->polling * HZ / 1000); mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling));
mod_timer(&ir->timer, timeout);
} }
/* ---------------------------------------------------------------*/ /* ---------------------------------------------------------------*/
...@@ -102,7 +100,7 @@ static int bttv_rc5_irq(struct bttv *btv) ...@@ -102,7 +100,7 @@ static int bttv_rc5_irq(struct bttv *btv)
struct timeval tv; struct timeval tv;
u32 gpio; u32 gpio;
u32 gap; u32 gap;
unsigned long current_jiffies, timeout; unsigned long current_jiffies;
/* read gpio port */ /* read gpio port */
gpio = bttv_gpio_read(&btv->c); gpio = bttv_gpio_read(&btv->c);
...@@ -139,8 +137,8 @@ static int bttv_rc5_irq(struct bttv *btv) ...@@ -139,8 +137,8 @@ static int bttv_rc5_irq(struct bttv *btv)
ir->base_time = tv; ir->base_time = tv;
ir->last_bit = 0; ir->last_bit = 0;
timeout = current_jiffies + (500 + 30 * HZ) / 1000; mod_timer(&ir->timer_end,
mod_timer(&ir->timer_end, timeout); current_jiffies + msecs_to_jiffies(30));
} }
/* toggle GPIO pin 4 to reset the irq */ /* toggle GPIO pin 4 to reset the irq */
...@@ -154,9 +152,7 @@ static int bttv_rc5_irq(struct bttv *btv) ...@@ -154,9 +152,7 @@ static int bttv_rc5_irq(struct bttv *btv)
static void bttv_ir_start(struct bttv *btv, struct card_ir *ir) static void bttv_ir_start(struct bttv *btv, struct card_ir *ir)
{ {
if (ir->polling) { if (ir->polling) {
init_timer(&ir->timer); setup_timer(&ir->timer, bttv_input_timer, (unsigned long)btv);
ir->timer.function = bttv_input_timer;
ir->timer.data = (unsigned long)btv;
ir->timer.expires = jiffies + HZ; ir->timer.expires = jiffies + HZ;
add_timer(&ir->timer); add_timer(&ir->timer);
} else if (ir->rc5_gpio) { } else if (ir->rc5_gpio) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment