summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-19 20:22:46 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-10-23 19:31:43 -0400
commitce23cbc857e0b1bccdc11ffa2fb8286021c70eec (patch)
tree4dbeee64f6bec796f0822357ebb9db9e7b6b4014 /drivers
parent91de76e661a266731fc2889a398ad1694df9d523 (diff)
Input: byd - convert to using 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> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/mouse/byd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c
index b64b81599f7e..f2aabf7f906f 100644
--- a/drivers/input/mouse/byd.c
+++ b/drivers/input/mouse/byd.c
@@ -227,6 +227,7 @@
227 227
228struct byd_data { 228struct byd_data {
229 struct timer_list timer; 229 struct timer_list timer;
230 struct psmouse *psmouse;
230 s32 abs_x; 231 s32 abs_x;
231 s32 abs_y; 232 s32 abs_y;
232 typeof(jiffies) last_touch_time; 233 typeof(jiffies) last_touch_time;
@@ -251,10 +252,10 @@ static void byd_report_input(struct psmouse *psmouse)
251 input_sync(dev); 252 input_sync(dev);
252} 253}
253 254
254static void byd_clear_touch(unsigned long data) 255static void byd_clear_touch(struct timer_list *t)
255{ 256{
256 struct psmouse *psmouse = (struct psmouse *)data; 257 struct byd_data *priv = from_timer(priv, t, timer);
257 struct byd_data *priv = psmouse->private; 258 struct psmouse *psmouse = priv->psmouse;
258 259
259 serio_pause_rx(psmouse->ps2dev.serio); 260 serio_pause_rx(psmouse->ps2dev.serio);
260 priv->touch = false; 261 priv->touch = false;
@@ -478,7 +479,8 @@ int byd_init(struct psmouse *psmouse)
478 if (!priv) 479 if (!priv)
479 return -ENOMEM; 480 return -ENOMEM;
480 481
481 setup_timer(&priv->timer, byd_clear_touch, (unsigned long) psmouse); 482 priv->psmouse = psmouse;
483 timer_setup(&priv->timer, byd_clear_touch, 0);
482 484
483 psmouse->private = priv; 485 psmouse->private = priv;
484 psmouse->disconnect = byd_disconnect; 486 psmouse->disconnect = byd_disconnect;