summaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/imx_keypad.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-24 09:40:57 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-10-24 10:04:44 -0700
commit4ea40278eb463aaa95889b00be78f8a56bb61131 (patch)
tree974f097739023f20473f495db31b6ffae20df826 /drivers/input/keyboard/imx_keypad.c
parenta11bc476b987925654369411dd8281a60cb5a175 (diff)
downloadlinux-4ea40278eb463aaa95889b00be78f8a56bb61131.tar.bz2
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 <keescook@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard/imx_keypad.c')
-rw-r--r--drivers/input/keyboard/imx_keypad.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 2165f3dd328b..25d61d8d4fc4 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -184,9 +184,9 @@ static void imx_keypad_fire_events(struct imx_keypad *keypad,
/*
* imx_keypad_check_for_events is the timer handler.
*/
-static void imx_keypad_check_for_events(unsigned long data)
+static void imx_keypad_check_for_events(struct timer_list *t)
{
- struct imx_keypad *keypad = (struct imx_keypad *) data;
+ struct imx_keypad *keypad = from_timer(keypad, t, check_matrix_timer);
unsigned short matrix_volatile_state[MAX_MATRIX_KEY_COLS];
unsigned short reg_val;
bool state_changed, is_zero_matrix;
@@ -456,8 +456,8 @@ static int imx_keypad_probe(struct platform_device *pdev)
keypad->irq = irq;
keypad->stable_count = 0;
- setup_timer(&keypad->check_matrix_timer,
- imx_keypad_check_for_events, (unsigned long) keypad);
+ timer_setup(&keypad->check_matrix_timer,
+ imx_keypad_check_for_events, 0);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);