From patchwork Sat Jan 21 18:46:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9530619 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 5A43F6020B for ; Sat, 21 Jan 2017 18:49:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A2AE283BC for ; Sat, 21 Jan 2017 18:49:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EE62283F9; Sat, 21 Jan 2017 18:49:28 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D9AE1283BC for ; Sat, 21 Jan 2017 18:49:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cV0j3-0005ZZ-G4; Sat, 21 Jan 2017 18:49:21 +0000 Received: from bh-25.webhostbox.net ([208.91.199.152]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cV0iq-0003tu-Gx for linux-arm-kernel@lists.infradead.org; Sat, 21 Jan 2017 18:49:13 +0000 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=j1Zk6Drt1FyWrDy/yWMtyGILlTDlBBDdinSMkuslPPE=; b=3NTSbytpP+sWY9 W2eVr3gfLt0t2D8uIaTfql0x1Z8twFDQ0aRcps03kubx58VjIGi4NpRk36cwqocQhEsVi+9Cl3A4z kxSjt192uhonJrXnzdlDaGKGZNNWZUzI0oRcb1Lmnc9X+Rbvr20UJfSZtUxSFtvyDZzHgns0uBSJu pFvu/Ispy/A38UkYiql48LYOgz1M0iNmHP1axBPK4XFYlfwhtsPTFbwA8kkJ1Zy7CeVtP7uByU96Y ERlD2IRUEFlwzVKPVdetVkYm7FK7/j4KF3Yu+8hbC9+G9iN2qES0IQ2qooS5S/U3rhqX+zZEXZuoq WeDZPYswZnhFbNgv4OHw==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:48108 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cV0iX-001weF-E7; Sat, 21 Jan 2017 18:48:49 +0000 From: Guenter Roeck To: Dmitry Torokhov Subject: [PATCH 11/13] Input: touchscreen - drop unnecessary calls to device_init_wakeup Date: Sat, 21 Jan 2017 10:46:03 -0800 Message-Id: <1485024365-3368-12-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 - lists.infradead.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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170121_104908_948454_2FFAB304 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Zapolskiy , Guenter Roeck , Sylvain Lemieux , Petr Cvek , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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/touchscreen/ads7846.c | 2 -- drivers/input/touchscreen/bu21013_ts.c | 2 -- drivers/input/touchscreen/eeti_ts.c | 1 - drivers/input/touchscreen/lpc32xx_ts.c | 1 - drivers/input/touchscreen/st1232.c | 1 - 5 files changed, 7 deletions(-) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 1ce3ecbe37f8..f5793e3d945f 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -1462,8 +1462,6 @@ static int ads7846_remove(struct spi_device *spi) { struct ads7846 *ts = spi_get_drvdata(spi); - device_init_wakeup(&spi->dev, false); - sysfs_remove_group(&spi->dev.kobj, &ads784x_attr_group); ads7846_disable(ts); diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index 931417eb4f5a..4fa5da8d5fa8 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c @@ -637,8 +637,6 @@ static int bu21013_remove(struct i2c_client *client) kfree(bu21013_data); - device_init_wakeup(&client->dev, false); - return 0; } diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c index fa974579eb41..16023867b9da 100644 --- a/drivers/input/touchscreen/eeti_ts.c +++ b/drivers/input/touchscreen/eeti_ts.c @@ -231,7 +231,6 @@ static int eeti_ts_probe(struct i2c_client *client, */ eeti_ts_stop(priv); - device_init_wakeup(&client->dev, 0); return 0; err3: diff --git a/drivers/input/touchscreen/lpc32xx_ts.c b/drivers/input/touchscreen/lpc32xx_ts.c index 7fbb3b0c8571..e0baa7de4102 100644 --- a/drivers/input/touchscreen/lpc32xx_ts.c +++ b/drivers/input/touchscreen/lpc32xx_ts.c @@ -313,7 +313,6 @@ static int lpc32xx_ts_remove(struct platform_device *pdev) struct lpc32xx_tsc *tsc = platform_get_drvdata(pdev); struct resource *res; - device_init_wakeup(&pdev->dev, 0); free_irq(tsc->irq, tsc); input_unregister_device(tsc->dev); diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index e943678ce54c..be5615c6bf8f 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -237,7 +237,6 @@ static int st1232_ts_remove(struct i2c_client *client) { struct st1232_ts_data *ts = i2c_get_clientdata(client); - device_init_wakeup(&client->dev, 0); st1232_ts_power(ts, false); return 0;