Input: gpio-keys - convert timers to use timer_setup()
authorstephen lu <lumotuwe@gmail.com>
Mon, 23 Oct 2017 21:43:53 +0000 (14:43 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 23 Oct 2017 23:31:53 +0000 (16:31 -0700)
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: Stephen Lu <lumotuwe@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/gpio_keys.c

index e9f0ebf3267add21d8c372a7853312fa1998a7e6..87e613dc33b804bf60047133f773343550e1a044 100644 (file)
@@ -419,9 +419,9 @@ static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static void gpio_keys_irq_timer(unsigned long _data)
+static void gpio_keys_irq_timer(struct timer_list *t)
 {
-       struct gpio_button_data *bdata = (struct gpio_button_data *)_data;
+       struct gpio_button_data *bdata = from_timer(bdata, t, release_timer);
        struct input_dev *input = bdata->input;
        unsigned long flags;
 
@@ -582,8 +582,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
                }
 
                bdata->release_delay = button->debounce_interval;
-               setup_timer(&bdata->release_timer,
-                           gpio_keys_irq_timer, (unsigned long)bdata);
+               timer_setup(&bdata->release_timer, gpio_keys_irq_timer, 0);
 
                isr = gpio_keys_irq_isr;
                irqflags = 0;