From 4ea40278eb463aaa95889b00be78f8a56bb61131 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 09:40:57 -0700 Subject: Input: keyboard - convert timers to use 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 Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/bf54x-keys.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/input/keyboard/bf54x-keys.c') diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c index 39bcbc38997f..8a07a426f88e 100644 --- a/drivers/input/keyboard/bf54x-keys.c +++ b/drivers/input/keyboard/bf54x-keys.c @@ -127,10 +127,9 @@ static inline void bfin_kpad_clear_irq(void) bfin_write_KPAD_ROWCOL(0xFFFF); } -static void bfin_kpad_timer(unsigned long data) +static void bfin_kpad_timer(struct timer_list *t) { - struct platform_device *pdev = (struct platform_device *) data; - struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev); + struct bf54x_kpad *bf54x_kpad = from_timer(bf54x_kpad, t, timer); if (bfin_kpad_get_keypressed(bf54x_kpad)) { /* Try again later */ @@ -298,7 +297,7 @@ static int bfin_kpad_probe(struct platform_device *pdev) /* Init Keypad Key Up/Release test timer */ - setup_timer(&bf54x_kpad->timer, bfin_kpad_timer, (unsigned long) pdev); + timer_setup(&bf54x_kpad->timer, bfin_kpad_timer, 0); bfin_write_KPAD_PRESCALE(bfin_kpad_get_prescale(TIME_SCALE)); -- cgit v1.2.3