From patchwork Mon Oct 23 08:21:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen lu X-Patchwork-Id: 10022165 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 118EE603D7 for ; Mon, 23 Oct 2017 08:21:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F201328673 for ; Mon, 23 Oct 2017 08:21:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E52392869A; Mon, 23 Oct 2017 08:21:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9156928673 for ; Mon, 23 Oct 2017 08:21:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750803AbdJWIVx (ORCPT ); Mon, 23 Oct 2017 04:21:53 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:53658 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbdJWIVw (ORCPT ); Mon, 23 Oct 2017 04:21:52 -0400 Received: by mail-pf0-f196.google.com with SMTP id t188so16556422pfd.10; Mon, 23 Oct 2017 01:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=5yiOmmJ+fgHQB/9Fr2gt1F0SotmRXwLqemmDSgJoGW0=; b=RvgMUgtJEOW9fJvbCL1qxFHsR4v/kXWWC8fN/MlmWNYun/jCOXZyvq7GeIYed9toXq V8J/X5aJWNX5T5YUiJQy1adOODdjgDJ+ujZt/1By3ii9ADGnTNFJVaic6gS7RBg9CAsi WqHLkWvT1tsGTNNFBlHs3YT8+Wiv+RuTZ0Z5xInM9OZYQvVa7GLBM9EKwIMx3qBDVK8t ua/df00vmZI8OCrVCzpxhpaR819MqwFAERNbuN9mTtcVNckCNutQakktjxJNDbENJlG4 D0+QbmP9+nWef23X3PLE4WoY1Yfy+mNRexbEG75ccOkTnP0mcjb5NTUo6e8Aov666MGl R8Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=5yiOmmJ+fgHQB/9Fr2gt1F0SotmRXwLqemmDSgJoGW0=; b=MffRxkrRDzvaWBAZWSZaQR/LbZEkv1a6o2f2lra6YIGZkWK0+4GU/6BVtLAI/Exjtw EtRrsyTuPuhrQApd4pkfiiUZ4krtj2mSd5fpmxJxxPp1iQdELrOjw+O31fLzN1L+ocpw UeB+yg/S+b9CoQZGOEyRCafjVrayDqaptRO7pqklWaaMnYuSOPNyihI/tUnoB4CbMebT qnRm8O5SyQ9ixs3JU7sxgt5iJhmAMtog9hTXFMQRiQNXyQnKiiO4KUI96pqhQjlhlPfM 5eybdHevfl3LHYF8Fcv5oBFgDpIo0Xw6uofOLlNuaL3lasY8nuxELVXcQhNHFMNBfnTK u+kg== X-Gm-Message-State: AMCzsaUG9S4xaO4XzncSg/4L6jDxFRfFGqEDhZyWlXXt40ICDJziTynJ u56FutMNqTehEMRQLxXHQ6Ht9uimf+89tsLD6Nc= X-Google-Smtp-Source: ABhQp+TyxoTHrbnMWTG+PyBWbPyD1IsXXnCGRXng8rLwk0UPYs8Y5udHmLXuZbVMr4G/h766U8HgzLf/HSi4ZZgRoC8= X-Received: by 10.98.74.93 with SMTP id x90mr12329066pfa.177.1508746911966; Mon, 23 Oct 2017 01:21:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.170.135 with HTTP; Mon, 23 Oct 2017 01:21:51 -0700 (PDT) From: stephen lu Date: Mon, 23 Oct 2017 16:21:51 +0800 Message-ID: Subject: [PATCH] input: gpio-keys: Convert timers to use timer_setup() To: dmitry.torokhov@gmail.com, 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 Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;