summaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/byd.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-19 17:22:46 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-10-23 16:31:43 -0700
commitce23cbc857e0b1bccdc11ffa2fb8286021c70eec (patch)
tree4dbeee64f6bec796f0822357ebb9db9e7b6b4014 /drivers/input/mouse/byd.c
parent91de76e661a266731fc2889a398ad1694df9d523 (diff)
downloadlinux-ce23cbc857e0b1bccdc11ffa2fb8286021c70eec.tar.gz
linux-ce23cbc857e0b1bccdc11ffa2fb8286021c70eec.tar.bz2
linux-ce23cbc857e0b1bccdc11ffa2fb8286021c70eec.zip
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/input/mouse/byd.c')
-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 @@
struct byd_data {
struct timer_list timer;
+ struct psmouse *psmouse;
s32 abs_x;
s32 abs_y;
typeof(jiffies) last_touch_time;
@@ -251,10 +252,10 @@ static void byd_report_input(struct psmouse *psmouse)
input_sync(dev);
}
-static void byd_clear_touch(unsigned long data)
+static void byd_clear_touch(struct timer_list *t)
{
- struct psmouse *psmouse = (struct psmouse *)data;
- struct byd_data *priv = psmouse->private;
+ struct byd_data *priv = from_timer(priv, t, timer);
+ struct psmouse *psmouse = priv->psmouse;
serio_pause_rx(psmouse->ps2dev.serio);
priv->touch = false;
@@ -478,7 +479,8 @@ int byd_init(struct psmouse *psmouse)
if (!priv)
return -ENOMEM;
- setup_timer(&priv->timer, byd_clear_touch, (unsigned long) psmouse);
+ priv->psmouse = psmouse;
+ timer_setup(&priv->timer, byd_clear_touch, 0);
psmouse->private = priv;
psmouse->disconnect = byd_disconnect;