summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-img-scb.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-16 16:27:29 -0700
committerWolfram Sang <wsa@the-dreams.de>2017-10-27 15:53:30 +0200
commitb9e43e363d0115ca981c106d968e24140ad37f6c (patch)
treea7793b0a759b117d0a0de479eff885e41d3e3271 /drivers/i2c/busses/i2c-img-scb.c
parent3990bedea6e96cb1f182dbeadd62215dbb9e1c85 (diff)
i2c/busses: 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. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-img-scb.c')
-rw-r--r--drivers/i2c/busses/i2c-img-scb.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c
index eb1d91b986fd..823b0b33b2cb 100644
--- a/drivers/i2c/busses/i2c-img-scb.c
+++ b/drivers/i2c/busses/i2c-img-scb.c
@@ -826,9 +826,9 @@ next_atomic_cmd:
* Timer function to check if something has gone wrong in automatic mode (so we
* don't have to handle so many interrupts just to catch an exception).
*/
-static void img_i2c_check_timer(unsigned long arg)
+static void img_i2c_check_timer(struct timer_list *t)
{
- struct img_i2c *i2c = (struct img_i2c *)arg;
+ struct img_i2c *i2c = from_timer(i2c, t, check_timer);
unsigned long flags;
unsigned int line_status;
@@ -1362,8 +1362,7 @@ static int img_i2c_probe(struct platform_device *pdev)
}
/* Set up the exception check timer */
- setup_timer(&i2c->check_timer, img_i2c_check_timer,
- (unsigned long)i2c);
+ timer_setup(&i2c->check_timer, img_i2c_check_timer, 0);
i2c->bitrate = timings[0].max_bitrate;
if (!of_property_read_u32(node, "clock-frequency", &val))