From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: stephen lu <lumotuwe@gmail.com>
Cc: linus.walleij@linaro.org, linux@roeck-us.net,
jacek.anaszewski@gmail.com, boris.brezillon@free-electrons.com,
andriy.shevchenko@linux.intel.com,
alexander.stein@systec-electronic.com, hdegoede@redhat.com,
geert+renesas@glider.be, josephl@nvidia.com,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] input: gpio-keys: Convert timers to use timer_setup()
Date: Mon, 23 Oct 2017 14:50:56 -0700 [thread overview]
Message-ID: <20171023215056.kclz7l5lagngh2qh@dtor-ws> (raw)
In-Reply-To: <CABCPcVWqeiJNWfow34ouSwvtKoDF+egFQjXtqt+iPwNUKwgc7g@mail.gmail.com>
Hi Stephen,
On Mon, Oct 23, 2017 at 04:21:51PM +0800, stephen lu wrote:
> 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>
>
> ---
> 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);
Why are you keeping the original call to setup_timer()?
Also, your patch was line-wrapped, with tabs converted to spaces. I
fixed this all up, but please make sure you do not send mangled patches
next time. Look into git send-email.
Thanks.
--
Dmitry
prev parent reply other threads:[~2017-10-23 21:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-23 8:21 [PATCH] input: gpio-keys: Convert timers to use timer_setup() stephen lu
2017-10-23 21:50 ` Dmitry Torokhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171023215056.kclz7l5lagngh2qh@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=alexander.stein@systec-electronic.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=boris.brezillon@free-electrons.com \
--cc=geert+renesas@glider.be \
--cc=hdegoede@redhat.com \
--cc=jacek.anaszewski@gmail.com \
--cc=josephl@nvidia.com \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lumotuwe@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).