Commit ce23cbc8 authored by Kees Cook's avatar Kees Cook Committed by Dmitry Torokhov

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: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarPali Rohár <pali.rohar@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 91de76e6
...@@ -227,6 +227,7 @@ ...@@ -227,6 +227,7 @@
struct byd_data { struct byd_data {
struct timer_list timer; struct timer_list timer;
struct psmouse *psmouse;
s32 abs_x; s32 abs_x;
s32 abs_y; s32 abs_y;
typeof(jiffies) last_touch_time; typeof(jiffies) last_touch_time;
...@@ -251,10 +252,10 @@ static void byd_report_input(struct psmouse *psmouse) ...@@ -251,10 +252,10 @@ static void byd_report_input(struct psmouse *psmouse)
input_sync(dev); 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 = from_timer(priv, t, timer);
struct byd_data *priv = psmouse->private; struct psmouse *psmouse = priv->psmouse;
serio_pause_rx(psmouse->ps2dev.serio); serio_pause_rx(psmouse->ps2dev.serio);
priv->touch = false; priv->touch = false;
...@@ -478,7 +479,8 @@ int byd_init(struct psmouse *psmouse) ...@@ -478,7 +479,8 @@ int byd_init(struct psmouse *psmouse)
if (!priv) if (!priv)
return -ENOMEM; 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->private = priv;
psmouse->disconnect = byd_disconnect; psmouse->disconnect = byd_disconnect;
......
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