[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABCPcVWqeiJNWfow34ouSwvtKoDF+egFQjXtqt+iPwNUKwgc7g@mail.gmail.com>
Date: Mon, 23 Oct 2017 16:21:51 +0800
From: stephen lu <lumotuwe@...il.com>
To: dmitry.torokhov@...il.com, linus.walleij@...aro.org,
linux@...ck-us.net, jacek.anaszewski@...il.com,
boris.brezillon@...e-electrons.com,
andriy.shevchenko@...ux.intel.com,
alexander.stein@...tec-electronic.com, hdegoede@...hat.com,
geert+renesas@...der.be, josephl@...dia.com
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] input: gpio-keys: 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: Stephen Lu <lumotuwe@...il.com>
---
drivers/input/keyboard/gpio_keys.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/gpio_keys.c
b/drivers/input/keyboard/gpio_keys.c
index e9f0ebf..25ddc33 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -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;
@@ -584,6 +584,8 @@ 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;
--
1.9.1
Powered by blists - more mailing lists