From patchwork Mon Jan 23 00:48:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9531557 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 D772F6020B for ; Mon, 23 Jan 2017 00:48:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C28B227E3E for ; Mon, 23 Jan 2017 00:48:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4CCA27E33; Mon, 23 Jan 2017 00:48: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_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 4682227E33 for ; Mon, 23 Jan 2017 00:48:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750707AbdAWAsx (ORCPT ); Sun, 22 Jan 2017 19:48:53 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:54009 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704AbdAWAsw (ORCPT ); Sun, 22 Jan 2017 19:48:52 -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=2zvhZcL+MHAok2be9wuuFrq0rl1oiEVvjYoW6Awjoi4=; b=W/+a9sJL82bDZT /kJ+RJNPPqs4fx3jhjR9F4FOxfAPZbBPAAFtciw/5rQwm3hFGUChAhb3bvNpTFIBi+r27XCe8nFiE N+moaglEtop6pUhXkn8KBaf4YPWDdH8R8ODRW6fe06bpOHm5pzq06YySzJtuD1+K3SqtUBMGSNE81 w9SGdhqH5eGhyWVqNxrejl4eKL4AifGHIbbULqDvERG40qvAAiFMjVXDhXjlZdTV8DfTl/fhuYOmT D86FbhgqeG3aVhWJ4UU7nzq9RBhPq1g4hKbFzWV+rhOonWQyv8mfiK+xVwKPzH39W1S5/b9mAckXY fJY4f8fn6S2Vl52kcrNQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:35504 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cVSoU-000HoK-Le; Mon, 23 Jan 2017 00:48:51 +0000 From: Guenter Roeck To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH 1/5] Input: keyboard - drop unnecessary calls to input_set_drvdata Date: Sun, 22 Jan 2017 16:48:20 -0800 Message-Id: <1485132505-14562-2-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485132505-14562-1-git-send-email-linux@roeck-us.net> References: <1485132505-14562-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 If there is no call to dev_get_drvdata() or input_get_drvdata(), the call to input_set_drvdata() is unnecessary and can be dropped. The conversion was done automatically using the following coccinelle script. @used@ @@ ( input_get_drvdata(...) | dev_get_drvdata(...) ) @depends on !used@ @@ - input_set_drvdata(...); Signed-off-by: Guenter Roeck --- drivers/input/keyboard/adp5520-keys.c | 2 -- drivers/input/keyboard/bf54x-keys.c | 2 -- drivers/input/keyboard/maple_keyb.c | 1 - drivers/input/keyboard/opencores-kbd.c | 2 -- drivers/input/keyboard/tca8418_keypad.c | 2 -- drivers/input/keyboard/tm2-touchkey.c | 2 -- 6 files changed, 11 deletions(-) diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c index db1004dad108..f0b9b37bde58 100644 --- a/drivers/input/keyboard/adp5520-keys.c +++ b/drivers/input/keyboard/adp5520-keys.c @@ -107,8 +107,6 @@ static int adp5520_keys_probe(struct platform_device *pdev) input->phys = "adp5520-keys/input0"; input->dev.parent = &pdev->dev; - input_set_drvdata(input, dev); - input->id.bustype = BUS_I2C; input->id.vendor = 0x0001; input->id.product = 0x5520; diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c index 81b07dddae86..39bcbc38997f 100644 --- a/drivers/input/keyboard/bf54x-keys.c +++ b/drivers/input/keyboard/bf54x-keys.c @@ -268,8 +268,6 @@ static int bfin_kpad_probe(struct platform_device *pdev) input->phys = "bf54x-keys/input0"; input->dev.parent = &pdev->dev; - input_set_drvdata(input, bf54x_kpad); - input->id.bustype = BUS_HOST; input->id.vendor = 0x0001; input->id.product = 0x0001; diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index 5aa2361aef95..78e3567ec18c 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -196,7 +196,6 @@ static int probe_maple_kbd(struct device *dev) __clear_bit(KEY_RESERVED, idev->keybit); input_set_capability(idev, EV_MSC, MSC_SCAN); - input_set_drvdata(idev, kbd); error = input_register_device(idev); if (error) diff --git a/drivers/input/keyboard/opencores-kbd.c b/drivers/input/keyboard/opencores-kbd.c index 98ea6190f5f5..d62b4068c077 100644 --- a/drivers/input/keyboard/opencores-kbd.c +++ b/drivers/input/keyboard/opencores-kbd.c @@ -75,8 +75,6 @@ static int opencores_kbd_probe(struct platform_device *pdev) input->name = pdev->name; input->phys = "opencores-kbd/input0"; - input_set_drvdata(input, opencores_kbd); - input->id.bustype = BUS_HOST; input->id.vendor = 0x0001; input->id.product = 0x0001; diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 11d5c76d9fb4..9f6308fac0b4 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -358,8 +358,6 @@ static int tca8418_keypad_probe(struct i2c_client *client, __set_bit(EV_REP, input->evbit); input_set_capability(input, EV_MSC, MSC_SCAN); - input_set_drvdata(input, keypad_data); - irq = client->irq; if (irq_is_gpio) irq = gpio_to_irq(irq); diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c index 916e2f3a9bbb..485900f953e0 100644 --- a/drivers/input/keyboard/tm2-touchkey.c +++ b/drivers/input/keyboard/tm2-touchkey.c @@ -193,8 +193,6 @@ static int tm2_touchkey_probe(struct i2c_client *client, input_set_capability(touchkey->input_dev, EV_KEY, KEY_PHONE); input_set_capability(touchkey->input_dev, EV_KEY, KEY_BACK); - input_set_drvdata(touchkey->input_dev, touchkey); - error = input_register_device(touchkey->input_dev); if (error) { dev_err(&client->dev,