Input: locomokbd - use setup_timer
authorGeliang Tang <geliangtang@gmail.com>
Tue, 11 Apr 2017 03:38:10 +0000 (20:38 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 11 Apr 2017 03:41:40 +0000 (20:41 -0700)
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/locomokbd.c

index c94d610b9d78cd27dcd22c14da8f9fe0bf0dbb4b..0d74312d5b02c1e853ac76368c9a1794819ea3a0 100644 (file)
@@ -264,9 +264,8 @@ static int locomokbd_probe(struct locomo_dev *dev)
 
        spin_lock_init(&locomokbd->lock);
 
-       init_timer(&locomokbd->timer);
-       locomokbd->timer.function = locomokbd_timer_callback;
-       locomokbd->timer.data = (unsigned long) locomokbd;
+       setup_timer(&locomokbd->timer, locomokbd_timer_callback,
+                   (unsigned long)locomokbd);
 
        locomokbd->suspend_jiffies = jiffies;