From patchwork Wed Jan 18 17:46:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9524395 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 172BE60113 for ; Wed, 18 Jan 2017 17:48:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07FE926E8A for ; Wed, 18 Jan 2017 17:48:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF9122860D; Wed, 18 Jan 2017 17:48:09 +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_SIGNED, 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 A52DA26E8A for ; Wed, 18 Jan 2017 17:48:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753074AbdARRrz (ORCPT ); Wed, 18 Jan 2017 12:47:55 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:56985 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752975AbdARRrc (ORCPT ); Wed, 18 Jan 2017 12:47:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=m1W2abdsrqIZsWT4MbnspcihRKxtgCxYl07KPmBTugY=; b=GZYdeS97Y9aMRb akmv04+b4PNYaC75pfQuE2Nb1Wir5Hn10gYgcZS/MevAz5yTOl1RXVXvBZPZfQuHsydLuiUZqrINp H2X7HtjtphOOU7fSbhLr4J/Alnj6EwF/0DhcA38RKXDxcQLO0WvckApIss7A2jcA2gCBv59vd+V8T IlLZUJyE09yVS7OVQxx6i4eRi0/zsJp2ocg4TIFwh0K/Oeo3nA/P9Y/r8eun86Z5DXf2f5kTWUEQr 0iwNogi9SvbE1cSV0GetdKy8ie+QoMRt/uUdhgseJ3vmLHnO49LrslKBEuAl6UCDfNySCyYgaKR1V 0/GYL7NqEjhCU2g3XjRQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:45148 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cTuKS-001imy-Pm; Wed, 18 Jan 2017 17:47:26 +0000 From: Guenter Roeck To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Brian Norris , Douglas Anderson , Lee Jones , Vic Yang Subject: [PATCH 04/33] Input: cros_ec_keyb - Drop unnecessary call to dev_set_drvdata and other changes Date: Wed, 18 Jan 2017 09:46:25 -0800 Message-Id: <1484761614-12225-5-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484761614-12225-1-git-send-email-linux@roeck-us.net> References: <1484761614-12225-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: 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 There is no call to platform_get_drvdata() or dev_get_drvdata(). Drop the unnecessary call to dev_set_drvdata(). Other relevant changes: Use existing variable 'dev' instead of dereferencing it several times This conversion was done automatically with coccinelle using the following semantic patches. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches - Drop dev_set_drvdata() - Use local variable 'struct device *dev' consistently Signed-off-by: Guenter Roeck --- drivers/input/keyboard/cros_ec_keyb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index 25943e9bc8bf..87d071ae21da 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -222,7 +222,7 @@ static int cros_ec_keyb_probe(struct platform_device *pdev) struct device_node *np; int err; - np = pdev->dev.of_node; + np = dev->of_node; if (!np) return -ENODEV; @@ -248,7 +248,6 @@ static int cros_ec_keyb_probe(struct platform_device *pdev) ckdev->ec = ec; ckdev->notifier.notifier_call = cros_ec_keyb_work; ckdev->dev = dev; - dev_set_drvdata(dev, ckdev); idev->name = CROS_EC_DEV_NAME; idev->phys = ec->phys_name;