Commit a88cd60f authored by Kees Cook's avatar Kees Cook Committed by Mauro Carvalho Chehab

media: tc358743: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 3e314917
...@@ -1481,9 +1481,9 @@ static irqreturn_t tc358743_irq_handler(int irq, void *dev_id) ...@@ -1481,9 +1481,9 @@ static irqreturn_t tc358743_irq_handler(int irq, void *dev_id)
return handled ? IRQ_HANDLED : IRQ_NONE; return handled ? IRQ_HANDLED : IRQ_NONE;
} }
static void tc358743_irq_poll_timer(unsigned long arg) static void tc358743_irq_poll_timer(struct timer_list *t)
{ {
struct tc358743_state *state = (struct tc358743_state *)arg; struct tc358743_state *state = from_timer(state, t, timer);
unsigned int msecs; unsigned int msecs;
schedule_work(&state->work_i2c_poll); schedule_work(&state->work_i2c_poll);
...@@ -2153,8 +2153,7 @@ static int tc358743_probe(struct i2c_client *client, ...@@ -2153,8 +2153,7 @@ static int tc358743_probe(struct i2c_client *client,
} else { } else {
INIT_WORK(&state->work_i2c_poll, INIT_WORK(&state->work_i2c_poll,
tc358743_work_i2c_poll); tc358743_work_i2c_poll);
setup_timer(&state->timer, tc358743_irq_poll_timer, timer_setup(&state->timer, tc358743_irq_poll_timer, 0);
(unsigned long)state);
state->timer.expires = jiffies + state->timer.expires = jiffies +
msecs_to_jiffies(POLL_INTERVAL_MS); msecs_to_jiffies(POLL_INTERVAL_MS);
add_timer(&state->timer); add_timer(&state->timer);
......
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