From patchwork Mon Oct 23 08:40:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen lu X-Patchwork-Id: 10022177 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 EBAD4601E8 for ; Mon, 23 Oct 2017 08:40:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D984428735 for ; Mon, 23 Oct 2017 08:40:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCA44287B9; Mon, 23 Oct 2017 08:40:30 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 7B7DB28735 for ; Mon, 23 Oct 2017 08:40:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751121AbdJWIk3 (ORCPT ); Mon, 23 Oct 2017 04:40:29 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:51752 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbdJWIk2 (ORCPT ); Mon, 23 Oct 2017 04:40:28 -0400 Received: by mail-pf0-f195.google.com with SMTP id n14so16575914pfh.8; Mon, 23 Oct 2017 01:40:28 -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=0+FeKwuBm/0wnkJooyi4j1u9FUGUF8wy8wo8nk0zOuE=; b=CsVndTfsYb5Imr18XcMwkjn4lahdzFTDtJ2S4VvBhDd2XeNZG/Ntit/pX/0BH1JIzX D832yLX0UrJIRFiLF9mX4JBOAw6K8L3QBsxF61MX5X6Pckr1aRkNyGdsUna9a/S9CivB WVR9Yk3xue9YRReqqZrgirOER48Hg+eSVNY3FgpKR/ZCgQuR5OnmyeEBlXn+pp4cAEPj 08DGN3miBGBu5snBeEKrk6fr9AD09lM+FPZSBxFZyMB/d0jp3t4RBSp4qssnEPvoulKo aJ7uJF83WrZCIi/X+y9N44KPV25VUQHKMIjgp4zcc+epP4gBmgipfkE00P0ytHa+tY91 JH7w== 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=0+FeKwuBm/0wnkJooyi4j1u9FUGUF8wy8wo8nk0zOuE=; b=auv8rMUNwkpFDiyYtfW+wx2M18Rtl3kkC38+MhZTLFFeD2ueu5ukCmYvfoFLwKvLKC vcHOR4pHlbvHC8N1iilVOFquEv2FDoShPFfG80tqdfMDxPRFslR/gYZNMdo1O2ThyH9J C869na3Or4/dp31uw0h37dhWfrmOwq2qYtOg0qjQOkb0q5ux5ej2CSQyVb2m3VsqZH0s O1WMiKTAsD5rTOgX9vY95TQsUTs1fObMzXvxWPYONquEAz9Vr3XhTG/XPZ+fVKnuS6dn r1GwBSdjJUb31f5uClSDOMeOITLwFq2KzEmIUE/tvDkadvwSgC8xmL3avDGJ+1iFUEQg jsNQ== X-Gm-Message-State: AMCzsaW2TQGx8264fOE2yjGftlsE4MPYnL3IjF3elYJfBX+LzOklJPXZ f+BZqRJHQruWBlihWMPzaxAo2miXh8HzZ9QXFQLXUmaK2bE= X-Google-Smtp-Source: ABhQp+SpHiSIKpl2ny/RHKoT3Qwwv+wCjZiXaV3UZzSTy8WCLzjHMdR+CbXt+skRAcYpNGGTnGMe2wf1wuAjJZlAmUY= X-Received: by 10.98.205.12 with SMTP id o12mr12682995pfg.339.1508748028243; Mon, 23 Oct 2017 01:40:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.170.135 with HTTP; Mon, 23 Oct 2017 01:40:27 -0700 (PDT) From: stephen lu Date: Mon, 23 Oct 2017 16:40:27 +0800 Message-ID: Subject: [PATCH] input: ad7877: Convert timers to use timer_setup() To: dmitry.torokhov@gmail.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/touchscreen/ad7877.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) spin_lock_irqsave(&ts->lock, flags); @@ -718,7 +718,7 @@ static int ad7877_probe(struct spi_device *spi) ts->spi = spi; ts->input = input_dev; - setup_timer(&ts->timer, ad7877_timer, (unsigned long) ts); + timer_setup(&ts->timer, ad7877_timer, 0); mutex_init(&ts->mutex); spin_lock_init(&ts->lock); diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index 9c250ae..0381c78 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -385,9 +385,9 @@ static inline void ad7877_ts_event_release(struct ad7877 *ts) input_sync(input_dev); } -static void ad7877_timer(unsigned long handle) +static void ad7877_timer(struct timer_list *t) { - struct ad7877 *ts = (void *)handle; + struct ad7877 *ts = from_timer(ts, t, timer); unsigned long flags;