From patchwork Sat Jan 21 18:46:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9530625 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 DD0816046A for ; Sat, 21 Jan 2017 18:49:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF71D283BC for ; Sat, 21 Jan 2017 18:49:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C44C6283EF; Sat, 21 Jan 2017 18:49:39 +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 6B2FC28468 for ; Sat, 21 Jan 2017 18:49:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751721AbdAUSti (ORCPT ); Sat, 21 Jan 2017 13:49:38 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:51393 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751518AbdAUStM (ORCPT ); Sat, 21 Jan 2017 13:49:12 -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=qvOu5sKsZZP+/H+3vtNTwxIghyAP4WETNZ6GzLKEb00=; b=UiMC0NYkykS4Nb w/+QXLp/990wo5Rmi9dW+5WIsHSVI5JH/TXEuxNcPJJB9J38MVX80K7C7tGmaBgFf9hQdRzyrhkjD PL+DyUj648OsFwLD+l7rx1eMLBbc6a6ro6t7SsVFAIF3ukvTjI8N2zBDCUPorcBPo+Yxd9GndxotS /iWqh1wQoe9z3MJflyhat732dSdPkMl+lFoKZ8aQYPVNYIZzKU8KdAPRafd5eRREj/hVvU8kpiZBV sE3rOh4dIpSfUEvxKTk0T8cqmr/48cgZr9YmkBUMaEPbemn496LvPVW75UQ6IupWcEBpfGxplYBLZ Z2YdQsREcAQMmfFx8lCQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:48110 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cV0iY-001whM-LH; Sat, 21 Jan 2017 18:48:50 +0000 From: Guenter Roeck To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , devel@linuxdriverproject.org, Haiyang Zhang , "K. Y. Srinivasan" , Stephen Hemminger Subject: [PATCH 12/13] Input: serio - drop unnecessary calls to device_init_wakeup Date: Sat, 21 Jan 2017 10:46:04 -0800 Message-Id: <1485024365-3368-13-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/serio/hyperv-keyboard.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/serio/hyperv-keyboard.c b/drivers/input/serio/hyperv-keyboard.c index c948866edf87..25151d9214e0 100644 --- a/drivers/input/serio/hyperv-keyboard.c +++ b/drivers/input/serio/hyperv-keyboard.c @@ -402,7 +402,6 @@ static int hv_kbd_remove(struct hv_device *hv_dev) { struct hv_kbd_dev *kbd_dev = hv_get_drvdata(hv_dev); - device_init_wakeup(&hv_dev->device, false); serio_unregister_port(kbd_dev->hv_serio); vmbus_close(hv_dev->channel); kfree(kbd_dev);