From: Kees Cook Date: Fri, 20 Oct 2017 00:22:46 +0000 (-0700) Subject: Input: ff_memless - convert to using timer_setup() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=34445d4b3814b22a225819566f85516f3b04808f;p=openwrt%2Fstaging%2Fblogic.git Input: ff_memless - 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 Reviewed-by: Pali Rohár Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index fcc6c3368182..2743ed4656e4 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c @@ -412,10 +412,10 @@ static void ml_play_effects(struct ml_device *ml) ml_schedule_timer(ml); } -static void ml_effect_timer(unsigned long timer_data) +static void ml_effect_timer(struct timer_list *t) { - struct input_dev *dev = (struct input_dev *)timer_data; - struct ml_device *ml = dev->ff->private; + struct ml_device *ml = from_timer(ml, t, timer); + struct input_dev *dev = ml->dev; unsigned long flags; pr_debug("timer: updating effects\n"); @@ -526,7 +526,7 @@ int input_ff_create_memless(struct input_dev *dev, void *data, ml->private = data; ml->play_effect = play_effect; ml->gain = 0xffff; - setup_timer(&ml->timer, ml_effect_timer, (unsigned long)dev); + timer_setup(&ml->timer, ml_effect_timer, 0); set_bit(FF_GAIN, dev->ffbit);