diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-17 01:10:27 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-10-31 11:39:24 +0100 |
commit | a88cd60fc94e7e04e61adeb1c6f6ba16031913f8 (patch) | |
tree | cabc1416b4ae5bc176aa90c8d59fc5a1b63acdaa /drivers/media/i2c/tc358743.c | |
parent | media: media/saa7146: Convert timers to use timer_setup() (diff) | |
download | linux-a88cd60fc94e7e04e61adeb1c6f6ba16031913f8.tar.xz linux-a88cd60fc94e7e04e61adeb1c6f6ba16031913f8.zip |
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: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/tc358743.c')
-rw-r--r-- | drivers/media/i2c/tc358743.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index d3cf016ad0a0..2b8181469b93 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1481,9 +1481,9 @@ static irqreturn_t tc358743_irq_handler(int irq, void *dev_id) 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; schedule_work(&state->work_i2c_poll); @@ -2153,8 +2153,7 @@ static int tc358743_probe(struct i2c_client *client, } else { INIT_WORK(&state->work_i2c_poll, tc358743_work_i2c_poll); - setup_timer(&state->timer, tc358743_irq_poll_timer, - (unsigned long)state); + timer_setup(&state->timer, tc358743_irq_poll_timer, 0); state->timer.expires = jiffies + msecs_to_jiffies(POLL_INTERVAL_MS); add_timer(&state->timer); |