From patchwork Sat Jan 21 18:46:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9530607 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 C94FC6046A for ; Sat, 21 Jan 2017 18:48:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB011283EF for ; Sat, 21 Jan 2017 18:48:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF13D28490; Sat, 21 Jan 2017 18:48:57 +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=unavailable 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 45B06283EF for ; Sat, 21 Jan 2017 18:48:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751629AbdAUSsn (ORCPT ); Sat, 21 Jan 2017 13:48:43 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:51160 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751621AbdAUSsi (ORCPT ); Sat, 21 Jan 2017 13:48:38 -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=OWFouNwkOBXH5NKurvkafF2vCIpnt80sy2wa9AdMxDo=; b=aYPCBeI4vYr5Sz 93g/3PsrqveJok+B7ut7kgP0OMS90u7V0Lu+BM0TUO8tkNHT7C60BuZdEl6ZCmvxWFmqFR4/MD6sk 8IBxEdgM53yvMCFHJMGAVyH9+qF6HY/Z7w3JxZC81CRFJ1vKiyIcL+Elrh3sTuxkFVIxyiFLy98zB mUGOzpz320CqsWyDrcEtXcCuUa1NAzkKxhFsrQXFoBPp4yS4F3UhKrUkbZ4nGCwzUisyLhuLKA+7R 8cjNp1Qkmbeqbyu396UHh3eRYfFyzj7IdiYYkmQAaz68O1LCtojeU1DxbW0L6G3vbllPdOKdbdR6S yDwZn9u6r1xkpqKV/FvA==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:48100 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cV0iK-001w4e-Hz; Sat, 21 Jan 2017 18:48:37 +0000 From: Guenter Roeck To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , linux-arm-kernel@lists.infradead.org, usrp-users@lists.ettus.com Subject: [PATCH 10/13] Input: misc - drop unnecessary calls to device_init_wakeup Date: Sat, 21 Jan 2017 10:46:02 -0800 Message-Id: <1485024365-3368-11-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485024365-3368-1-git-send-email-linux@roeck-us.net> References: <1485024365-3368-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 Calling device_init_wakeup in the remove function is unnecessary since the device is going away, and thus won't be able to cause any wakeups under any circumstances. Besides, the driver cleanup code already handles the necessary cleanup. Similar, disabling wakeup in the probe error path is unnecessary, as is disabling wakeup in the probe function in the first place. Changes were done automatically using the following coccinelle script. @probe@ identifier p, probefn; declarer name module_platform_driver_probe; position pos; @@ ( module_platform_driver_probe(p, probefn@pos); | struct platform_driver p = { .probe = probefn@pos, }; | struct i2c_driver p = { .probe = probefn@pos, }; | struct spi_driver p = { .probe = probefn@pos, }; ) @remove@ identifier p, removefn; @@ struct ( platform_driver | i2c_driver | spi_driver | hv_driver ) p = { .remove = \(__exit_p(removefn)\|removefn\), }; @depends on remove@ identifier remove.removefn; @@ removefn(...) { <+... - device_init_wakeup(...); ...+> } @depends on probe@ identifier probe.probefn; expression dev; @@ probefn(...) { <+... - device_init_wakeup(..., \(false\|0\)); ...+> } Signed-off-by: Guenter Roeck --- drivers/input/misc/88pm80x_onkey.c | 1 - drivers/input/misc/e3x0-button.c | 1 - drivers/input/misc/gp2ap002a00f.c | 2 -- drivers/input/misc/hisi_powerkey.c | 2 -- drivers/input/misc/pm8941-pwrkey.c | 1 - drivers/input/misc/pmic8xxx-pwrkey.c | 2 -- drivers/input/misc/sirfsoc-onkey.c | 2 -- 7 files changed, 11 deletions(-) diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c index cf9908f1e5d5..45a09497f680 100644 --- a/drivers/input/misc/88pm80x_onkey.c +++ b/drivers/input/misc/88pm80x_onkey.c @@ -143,7 +143,6 @@ static int pm80x_onkey_remove(struct platform_device *pdev) { struct pm80x_onkey_info *info = platform_get_drvdata(pdev); - device_init_wakeup(&pdev->dev, 0); pm80x_free_irq(info->pm80x, info->irq, info); input_unregister_device(info->idev); kfree(info); diff --git a/drivers/input/misc/e3x0-button.c b/drivers/input/misc/e3x0-button.c index b0b374112db3..1e50314db1ab 100644 --- a/drivers/input/misc/e3x0-button.c +++ b/drivers/input/misc/e3x0-button.c @@ -126,7 +126,6 @@ static int e3x0_button_probe(struct platform_device *pdev) static int e3x0_button_remove(struct platform_device *pdev) { - device_init_wakeup(&pdev->dev, 0); return 0; } diff --git a/drivers/input/misc/gp2ap002a00f.c b/drivers/input/misc/gp2ap002a00f.c index 3bfdfcc20485..c6a29e57b5e4 100644 --- a/drivers/input/misc/gp2ap002a00f.c +++ b/drivers/input/misc/gp2ap002a00f.c @@ -210,8 +210,6 @@ static int gp2a_remove(struct i2c_client *client) struct gp2a_data *dt = i2c_get_clientdata(client); const struct gp2a_platform_data *pdata = dt->pdata; - device_init_wakeup(&client->dev, false); - free_irq(client->irq, dt); input_unregister_device(dt->input); diff --git a/drivers/input/misc/hisi_powerkey.c b/drivers/input/misc/hisi_powerkey.c index c4c42124a059..baa81dccfc1f 100644 --- a/drivers/input/misc/hisi_powerkey.c +++ b/drivers/input/misc/hisi_powerkey.c @@ -122,8 +122,6 @@ static int hi65xx_powerkey_probe(struct platform_device *pdev) static int hi65xx_powerkey_remove(struct platform_device *pdev) { - device_init_wakeup(&pdev->dev, 0); - return 0; } diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c index e317b75357a0..18ad956454f1 100644 --- a/drivers/input/misc/pm8941-pwrkey.c +++ b/drivers/input/misc/pm8941-pwrkey.c @@ -266,7 +266,6 @@ static int pm8941_pwrkey_remove(struct platform_device *pdev) { struct pm8941_pwrkey *pwrkey = platform_get_drvdata(pdev); - device_init_wakeup(&pdev->dev, 0); unregister_reboot_notifier(&pwrkey->reboot_notifier); return 0; diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c index 67aab86048ad..c75be2dd00e7 100644 --- a/drivers/input/misc/pmic8xxx-pwrkey.c +++ b/drivers/input/misc/pmic8xxx-pwrkey.c @@ -440,8 +440,6 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev) static int pmic8xxx_pwrkey_remove(struct platform_device *pdev) { - device_init_wakeup(&pdev->dev, 0); - return 0; } diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c index ed7237f19539..a2ed0e4fcd0b 100644 --- a/drivers/input/misc/sirfsoc-onkey.c +++ b/drivers/input/misc/sirfsoc-onkey.c @@ -174,8 +174,6 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev) static int sirfsoc_pwrc_remove(struct platform_device *pdev) { - device_init_wakeup(&pdev->dev, 0); - return 0; }