From patchwork Wed Sep 20 12:57:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5B30CE79CE for ; Wed, 20 Sep 2023 12:58:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236089AbjITM6v (ORCPT ); Wed, 20 Sep 2023 08:58:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235304AbjITM6r (ORCPT ); Wed, 20 Sep 2023 08:58:47 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CE8012D for ; Wed, 20 Sep 2023 05:58:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmq-000588-U6; Wed, 20 Sep 2023 14:58:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmq-007gyQ-56; Wed, 20 Sep 2023 14:58:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmp-003ICV-S5; Wed, 20 Sep 2023 14:58:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Michael Hennerich , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 01/52] input: adp5520-keys - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:38 +0200 Message-Id: <20230920125829.1478827-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1831; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=sDIRovx61qE47X7u63C5Fpn3zLhxFmyy8YCWQAY9uqw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw0dEwKJIDKXb8Aa8hVkIfHeNUAgFh5dOtwE x0K4Z/nF8+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsNAAKCRCPgPtYfRL+ ThCvB/9qP/JE8OUDiLGI7bGtpaSTj9bSKnUA/HxaUcpWRMYjO3Xku9e9Ms9wMnDSF++TgdYBI8g XwvLQ0vr0x04pgimIKrlSG3S2zMMBn1MhYUZi91V6Q3Y+MMc3VMdpxL6gGRT0G/x8YqDXW/2r6E y8igyo6Iq4UKt1IejBTRH5M7op9E2lPpqX18aaFoy4nsS87NJmkmH/iVXyQzbLOz9J7GYRs4t3Q Rv3oJJOOZ90b+KH/4h1YWkwNNtRPYGLJO69Kc+u4QVH0K0xS41gGyVlKX/lGXOwMMtJOtTK4PjC J1YXgPwNLr5Z4S4uObMEM1DEKHBeNhlil++2mvTapFBjCiNX X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/keyboard/adp5520-keys.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c index 7851ffd678a8..10c248f0c1fc 100644 --- a/drivers/input/keyboard/adp5520-keys.c +++ b/drivers/input/keyboard/adp5520-keys.c @@ -168,14 +168,12 @@ static int adp5520_keys_probe(struct platform_device *pdev) return 0; } -static int adp5520_keys_remove(struct platform_device *pdev) +static void adp5520_keys_remove(struct platform_device *pdev) { struct adp5520_keys *dev = platform_get_drvdata(pdev); adp5520_unregister_notifier(dev->master, &dev->notifier, ADP5520_KP_IEN | ADP5520_KR_IEN); - - return 0; } static struct platform_driver adp5520_keys_driver = { @@ -183,7 +181,7 @@ static struct platform_driver adp5520_keys_driver = { .name = "adp5520-keys", }, .probe = adp5520_keys_probe, - .remove = adp5520_keys_remove, + .remove_new = adp5520_keys_remove, }; module_platform_driver(adp5520_keys_driver); From patchwork Wed Sep 20 12:57:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66733CE79D3 for ; Wed, 20 Sep 2023 12:59:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236133AbjITM7Q (ORCPT ); Wed, 20 Sep 2023 08:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235679AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2942128 for ; Wed, 20 Sep 2023 05:58:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-000589-Cy; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmq-007gyT-Cc; Wed, 20 Sep 2023 14:58:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmq-003ICY-33; Wed, 20 Sep 2023 14:58:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Benson Leung , Guenter Roeck , Greg Kroah-Hartman , Jonathan Cameron , =?utf-8?b?am9ld3UgKOWQsw==?= =?utf-8?b?5Luy5oyvKQ==?= , linux-input@vger.kernel.org, chrome-platform@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 02/52] input: cros_ec_keyb - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:39 +0200 Message-Id: <20230920125829.1478827-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1871; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OQAF2qHJlA9KLKk3dP+DprpXVKIrGZ6sgkYNptMGDH8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw1aRq26N6/CbIta7xEsZog2xli0BLq0OUjI 3oYKrm2SBaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsNQAKCRCPgPtYfRL+ Tn4KCACt5khoPHqdccJ9xpNL4578bL/MwxIHsczffxv00SF19LNh20bkE+f/y/dbNzxmsM7cDUZ XHhylbrNkdLmoV9VUx3QQNtXv++3Az6JJO6wCgzl2smJhNyvSE8PDgqE2Mff09OAx+SeyNUn8r3 ca0dq/izKuTSpEpczvYPD/3iCQFMfu1Q1Mq9qGDfyDLsUhB43eS4reStsCt2kj+IRn/FvzirfJo z2LbhJ5AFUzXZoGK66GwvG6Ucz3N57uPbs4tpKrVilVMB7kXxc0tKHUWovsAXUZF/v6iG/HzHcG P0JxThUCk385mg5xBe/ttLc7XRfVlpKgigyVEwhPaZU0Ci9r X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Tzung-Bi Shih --- drivers/input/keyboard/cros_ec_keyb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index 313b7a69dd69..30678a34cf64 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -743,14 +743,12 @@ static int cros_ec_keyb_probe(struct platform_device *pdev) return 0; } -static int cros_ec_keyb_remove(struct platform_device *pdev) +static void cros_ec_keyb_remove(struct platform_device *pdev) { struct cros_ec_keyb *ckdev = dev_get_drvdata(&pdev->dev); blocking_notifier_chain_unregister(&ckdev->ec->event_notifier, &ckdev->notifier); - - return 0; } #ifdef CONFIG_ACPI @@ -774,7 +772,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume); static struct platform_driver cros_ec_keyb_driver = { .probe = cros_ec_keyb_probe, - .remove = cros_ec_keyb_remove, + .remove_new = cros_ec_keyb_remove, .driver = { .name = "cros-ec-keyb", .dev_groups = cros_ec_keyb_groups, From patchwork Wed Sep 20 12:57:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 302B6CE79D0 for ; Wed, 20 Sep 2023 12:59:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236235AbjITM7Q (ORCPT ); Wed, 20 Sep 2023 08:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235970AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA33E13E for ; Wed, 20 Sep 2023 05:58:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-00058A-Hc; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmq-007gyW-J3; Wed, 20 Sep 2023 14:58:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmq-003ICd-9v; Wed, 20 Sep 2023 14:58:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Jonathan Cameron , Andy Shevchenko , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 03/52] input: ep93xx_keypad - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:40 +0200 Message-Id: <20230920125829.1478827-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1740; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hVWEogBRF9HOBpKbk4TbioPyeK/sU0xWv9lfkh7mdZc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw293JnWR4/NKW4uglnfwItjy/4XjR8tFvVx m3gMEDjgqWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsNgAKCRCPgPtYfRL+ Tpj9CACkcz0YAJJyTUZU3Dxf1tIQHnk9PaWlsSpFUPuXGSDFJgW2Bd7RqTT9JbKuotMd5ALhaRm +NwIFz/vvd4AOOKRKm67dvIZhfvvOp7vp02W1SqV65KpNAAj1W8092FvjW1kJEMPyMDZK1dhTwa Q07Nef9t1ne+/JEeObpxtNyKBsHinBj8jk7OdmE0yemYK++EpJ4r148j48K9zLaW0mgx/II3j12 SiLR+vFeE6oY8zwdAylp/NH15p5TVBKCGJRytc+YWCOGBQ3a7J/4mBKdvp3C568BHIqA/jvOPgC k3UUv8txBdyWAqZ/tK44yoCQXH2XT4x57dhLbpwIV8TqTEWL X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/keyboard/ep93xx_keypad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index 55075addcac2..6b811d6bf625 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -308,11 +308,9 @@ static int ep93xx_keypad_probe(struct platform_device *pdev) return 0; } -static int ep93xx_keypad_remove(struct platform_device *pdev) +static void ep93xx_keypad_remove(struct platform_device *pdev) { dev_pm_clear_wake_irq(&pdev->dev); - - return 0; } static struct platform_driver ep93xx_keypad_driver = { @@ -321,7 +319,7 @@ static struct platform_driver ep93xx_keypad_driver = { .pm = pm_sleep_ptr(&ep93xx_keypad_pm_ops), }, .probe = ep93xx_keypad_probe, - .remove = ep93xx_keypad_remove, + .remove_new = ep93xx_keypad_remove, }; module_platform_driver(ep93xx_keypad_driver); From patchwork Wed Sep 20 12:57:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392640 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BF3DCE79CF for ; Wed, 20 Sep 2023 12:58:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235925AbjITM6x (ORCPT ); Wed, 20 Sep 2023 08:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235957AbjITM6t (ORCPT ); Wed, 20 Sep 2023 08:58:49 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6A3B133 for ; Wed, 20 Sep 2023 05:58:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmr-00058K-HT; Wed, 20 Sep 2023 14:58:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmq-007gyZ-Sg; Wed, 20 Sep 2023 14:58:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmq-003ICh-JH; Wed, 20 Sep 2023 14:58:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Mattijs Korpershoek , Jeff LaBundy , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/52] input: iqs62x-keys - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:41 +0200 Message-Id: <20230920125829.1478827-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1961; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=mFcYl1wn77fniEtgx2E+xFlEporo/edpNsQGpHbkh4I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw4z/0x539b7hiWcLC1fP4I5yPm/9gXHUPMp wr3GMBP1AaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsOAAKCRCPgPtYfRL+ TmOsB/9xUS+E9aa53DGDmNeIzXaoCNxL2jwsMr53CztWh5OUgFI2/jcfrPKvu3NLBgkaemCl0zS MZeQ98R0d4pxj1eDtHNOZ/oUNPQtuFGrrprMVre/rl3PaGeq7zBn1sFvDSSWqYzfinpgm+EH4Gi +/tPMpLGZvXEnml9sZWurGVLl+++90ww18bBHwIpRbvWMGCHHLIqurZUq9OOngPgN5g4WFPFOgL 26+yV4R0cz5LfA/6uQA3LKgEdrF4Kup8xE0y4Ud2YoQGZvQDWJWKD2KV7ySlzQkmBdQ5X8a71PF ZXDYoVoYPcQ1Ci8A8PjVbF2gE8AvEufZz0HNOOjqlmIU9H4m X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Jeff LaBundy --- drivers/input/keyboard/iqs62x-keys.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/iqs62x-keys.c b/drivers/input/keyboard/iqs62x-keys.c index 02ceebad7bda..688d61244b5f 100644 --- a/drivers/input/keyboard/iqs62x-keys.c +++ b/drivers/input/keyboard/iqs62x-keys.c @@ -310,7 +310,7 @@ static int iqs62x_keys_probe(struct platform_device *pdev) return ret; } -static int iqs62x_keys_remove(struct platform_device *pdev) +static void iqs62x_keys_remove(struct platform_device *pdev) { struct iqs62x_keys_private *iqs62x_keys = platform_get_drvdata(pdev); int ret; @@ -319,8 +319,6 @@ static int iqs62x_keys_remove(struct platform_device *pdev) &iqs62x_keys->notifier); if (ret) dev_err(&pdev->dev, "Failed to unregister notifier: %d\n", ret); - - return 0; } static struct platform_driver iqs62x_keys_platform_driver = { @@ -328,7 +326,7 @@ static struct platform_driver iqs62x_keys_platform_driver = { .name = "iqs62x-keys", }, .probe = iqs62x_keys_probe, - .remove = iqs62x_keys_remove, + .remove_new = iqs62x_keys_remove, }; module_platform_driver(iqs62x_keys_platform_driver); From patchwork Wed Sep 20 12:57:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 467A4CE79CE for ; Wed, 20 Sep 2023 12:59:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236326AbjITM7T (ORCPT ); Wed, 20 Sep 2023 08:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236225AbjITM7H (ORCPT ); Wed, 20 Sep 2023 08:59:07 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CB6083 for ; Wed, 20 Sep 2023 05:58:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-00058L-Hp; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmr-007gyd-2a; Wed, 20 Sep 2023 14:58:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmq-003ICl-Pb; Wed, 20 Sep 2023 14:58:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Rob Herring , Jonathan Cameron , Andy Shevchenko , Siarhei Volkau , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/52] input: matrix_keypad - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:42 +0200 Message-Id: <20230920125829.1478827-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1870; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=I1Td0PO2J4ugZd+Am1WSsgRKvn3D9v2mPgdkK5T0Qyg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw51XKGlOHBdEL63PXfcbv1k/1WXIP5CYBWg 1uc/VzzChyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsOQAKCRCPgPtYfRL+ TkN0B/sEpM8MgHqk/0i89k60VqkFgWpj/8S0KLEhZIg52IQ253rXOX8JZnQwnX1dtNNb2CgmZ7g blx4R2Lh87wnBZXCX70Z/21a+n25fmgscYBhjTHBbzygvUO1y5OcBrn9U1sSSqmc5aTee1inOZH DrkWARqbikpCUYYNUM7mS7uWsOvTRjrAqAm+Nre6H5RlqKM7ZfAHpEOR+GgI/QuZNNy9v1vi0gF 7glaK827rrkPxv6/QqlzUPxD7q+/SP3cOSMyYBGn7WynvzfH3HQiXiGYVdUaqpqsSVeVrj1zqqh SU5wO18YTMQcjoy4jLox9eFcB3r3UeXgqKOO53An5gEeUj8U X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/keyboard/matrix_keypad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index a1b037891af2..50fa764c82d2 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -549,15 +549,13 @@ static int matrix_keypad_probe(struct platform_device *pdev) return err; } -static int matrix_keypad_remove(struct platform_device *pdev) +static void matrix_keypad_remove(struct platform_device *pdev) { struct matrix_keypad *keypad = platform_get_drvdata(pdev); matrix_keypad_free_gpio(keypad); input_unregister_device(keypad->input_dev); kfree(keypad); - - return 0; } #ifdef CONFIG_OF @@ -570,7 +568,7 @@ MODULE_DEVICE_TABLE(of, matrix_keypad_dt_match); static struct platform_driver matrix_keypad_driver = { .probe = matrix_keypad_probe, - .remove = matrix_keypad_remove, + .remove_new = matrix_keypad_remove, .driver = { .name = "matrix-keypad", .pm = pm_sleep_ptr(&matrix_keypad_pm_ops), From patchwork Wed Sep 20 12:57:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCB50CE79D1 for ; Wed, 20 Sep 2023 12:59:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236281AbjITM7L (ORCPT ); Wed, 20 Sep 2023 08:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235980AbjITM7E (ORCPT ); Wed, 20 Sep 2023 08:59:04 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7D85135 for ; Wed, 20 Sep 2023 05:58:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwms-00058M-Ss; Wed, 20 Sep 2023 14:58:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmr-007gyg-96; Wed, 20 Sep 2023 14:58:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmq-003ICp-Vs; Wed, 20 Sep 2023 14:58:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Pavel Machek , "Steven Rostedt (Google)" , Paolo Abeni , Kalle Valo , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/52] input: omap-keypad - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:43 +0200 Message-Id: <20230920125829.1478827-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1724; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uxlM5fM0hmcHs7yfBhv3L8aGpaydP5QBqb1hJSrgwIA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw6lXG7MS0w0/7gi+4czRm96EBdyJY5PuWth tJTUEtrZt6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsOgAKCRCPgPtYfRL+ Tmb/B/9NHv7mangivh8p6pAsSMlMsYqV7tmIc9olTin/8g7xHrPR3ChZPt5xx8ZVBNSufdbEx+k a3jvq7ejwglF8R7iAUaw+CLN9tv34DHCcO6xp0KUCI7drNxH9qSVWgzVA6OU9hIOM0vv4UQrsJK ABPSPkJ+0R94J1Ww61CfeDYziPBTz6br3+49OQlFicl9gaoPWKyBJIFvHPmOSHX5zVqCuiYg6ev HVudEm39UGnhOsXtFTJjng1jBJhXX/Gies7IRNswwzwLCMrPjDUOOOugSC2W37iGgkKsfOAB1WG WMV+eFkC7SyRckJ7ZLXCNNGbqKl5PfwU4yK3LXQUYer1wNyJ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/keyboard/omap-keypad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index 24440b498645..454fb8675657 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c @@ -287,7 +287,7 @@ static int omap_kp_probe(struct platform_device *pdev) return -EINVAL; } -static int omap_kp_remove(struct platform_device *pdev) +static void omap_kp_remove(struct platform_device *pdev) { struct omap_kp *omap_kp = platform_get_drvdata(pdev); @@ -303,13 +303,11 @@ static int omap_kp_remove(struct platform_device *pdev) input_unregister_device(omap_kp->input); kfree(omap_kp); - - return 0; } static struct platform_driver omap_kp_driver = { .probe = omap_kp_probe, - .remove = omap_kp_remove, + .remove_new = omap_kp_remove, .driver = { .name = "omap-keypad", }, From patchwork Wed Sep 20 12:57:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392670 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A58ECE79CE for ; Wed, 20 Sep 2023 12:59:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236234AbjITM7M (ORCPT ); Wed, 20 Sep 2023 08:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236133AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D96FD1B3 for ; Wed, 20 Sep 2023 05:58:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-00058Y-CP; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmr-007gyj-GQ; Wed, 20 Sep 2023 14:58:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmr-003ICt-6s; Wed, 20 Sep 2023 14:58:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Yangtao Li , Jonathan Cameron , Rob Herring , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/52] input: omap4-keypad - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:44 +0200 Message-Id: <20230920125829.1478827-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1764; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Uz/Y04WZLM79PWiMT26rLD1RyhwSjpu2sAD/2b79i2o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw7k2ZOP5UjEEGPagZNYfkqEykY/YNM9VXTA qr07CnY4KyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsOwAKCRCPgPtYfRL+ TnifB/4/9ZdLr1MGcWVixaHoyGkr1oOA1cGMfsDX2cxIbpBaDdv18X/uJXFn9QthuNOeWsE7CfK DSXBxtTjxnUlHI+L3FjAT5dyCPDCh0XfnB1GL0iVnRDyi+zw+dc7n/5V7x6DD0wUYHIteQGG/zZ k+UpVjszVZLpXT74UMzYc31twnNMIwhy4qxU/aVT+Idh/uX7kMbNszu0z6aRQo67UMfe8q2rAtx WWPnIJuBQK+63NAu8R+SPSGa7N24J571AEsjQ09nJj5k+nku1a7S9Dr9awdo2+qHiDaSze7d5BK rx5MxLFwBj/nFnEwEvtzPw5PUzAcKR9IZQjh3AhFgTZw786D X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/keyboard/omap4-keypad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 773e55eed88b..d3f8688fdd9c 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -461,11 +461,9 @@ static int omap4_keypad_probe(struct platform_device *pdev) return 0; } -static int omap4_keypad_remove(struct platform_device *pdev) +static void omap4_keypad_remove(struct platform_device *pdev) { dev_pm_clear_wake_irq(&pdev->dev); - - return 0; } static const struct of_device_id omap_keypad_dt_match[] = { @@ -476,7 +474,7 @@ MODULE_DEVICE_TABLE(of, omap_keypad_dt_match); static struct platform_driver omap4_keypad_driver = { .probe = omap4_keypad_probe, - .remove = omap4_keypad_remove, + .remove_new = omap4_keypad_remove, .driver = { .name = "omap4-keypad", .of_match_table = omap_keypad_dt_match, From patchwork Wed Sep 20 12:57:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2292CE79CE for ; Wed, 20 Sep 2023 12:59:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236009AbjITM7G (ORCPT ); Wed, 20 Sep 2023 08:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236153AbjITM66 (ORCPT ); Wed, 20 Sep 2023 08:58:58 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EB9319C for ; Wed, 20 Sep 2023 05:58:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-00058Z-CK; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmr-007gyn-M1; Wed, 20 Sep 2023 14:58:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmr-003ICx-Cd; Wed, 20 Sep 2023 14:58:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Rob Herring , Jonathan Cameron , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/52] input: samsung-keypad - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:45 +0200 Message-Id: <20230920125829.1478827-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2016; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=sSjxlRI6ic64GKrn1BxzxBl1JS/1ZiAMfsKC/c/RCSc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw8mIy0OFnL13R9o77RfYTsxf041GZZpwWK3 yiSHoRVaBKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsPAAKCRCPgPtYfRL+ TmrVB/9xlJmcQhEB1fh3aklpZ08zq/tbsb2im9IdDWcmcGb0XlpXnuaQClcD+T9T+IFsNvYgzQk cL+sQgXK4YLxYyg6q3iDgHRF8jMJElFu5e65n9xhPaMqLhMQbJtct9H/E7yaG9zibwbsYi2k71g rNbAYlRiVWbxYyv3xQtMQ4aydl05jX9kohWng4ogdIs3pnz8EsNnEruTnmuRofRXkz06/BiOBVq D/ne8Z+z2jQ9DniUmhrrRhA6XGAZyJrqi+sDjB5NKRhEPf5FFFrzDmVqkefHsrtwIPzK8NYAI1o qfkc97ve+6p241GkbIGo5slY3tb2sZNPwRJ0YRMMUIXAVgNp X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/keyboard/samsung-keypad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index d85dd2489293..e212eff7687c 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c @@ -444,7 +444,7 @@ static int samsung_keypad_probe(struct platform_device *pdev) return error; } -static int samsung_keypad_remove(struct platform_device *pdev) +static void samsung_keypad_remove(struct platform_device *pdev) { struct samsung_keypad *keypad = platform_get_drvdata(pdev); @@ -453,8 +453,6 @@ static int samsung_keypad_remove(struct platform_device *pdev) input_unregister_device(keypad->input_dev); clk_unprepare(keypad->clk); - - return 0; } static int samsung_keypad_runtime_suspend(struct device *dev) @@ -589,7 +587,7 @@ MODULE_DEVICE_TABLE(platform, samsung_keypad_driver_ids); static struct platform_driver samsung_keypad_driver = { .probe = samsung_keypad_probe, - .remove = samsung_keypad_remove, + .remove_new = samsung_keypad_remove, .driver = { .name = "samsung-keypad", .of_match_table = of_match_ptr(samsung_keypad_dt_match), From patchwork Wed Sep 20 12:57:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392646 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E44ECE79D3 for ; Wed, 20 Sep 2023 12:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235840AbjITM67 (ORCPT ); Wed, 20 Sep 2023 08:58:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235913AbjITM6x (ORCPT ); Wed, 20 Sep 2023 08:58:53 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDC20192 for ; Wed, 20 Sep 2023 05:58:41 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-000598-CK; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmr-007gyq-Sv; Wed, 20 Sep 2023 14:58:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmr-003ID0-JT; Wed, 20 Sep 2023 14:58:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Jonathan Cameron , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/52] input: sh_keysc - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:46 +0200 Message-Id: <20230920125829.1478827-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1875; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=si1Zq7PbnoLR8C6Vk0+95TiCWhbJeEvCoeN23l/FiEY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw9Gq+iACu+iO2T67G9ZjDbm0nOKBtA6UIPz Z8VHSwBb6WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsPQAKCRCPgPtYfRL+ Tn8DCACe1tA8pYCcIMnY2OUxhWAMQd69+7DZt2j3KIAIOkPLdEmMRm5d00nBGg58/N6c65WKJ33 S2fHpaWRpQtk5lLeVHlUJlh5xqlDkYa0aGQzUHbFtMQwNuTg2eVrw/ryjsBFUFpvtmqG1VF50Eg ohs3aqFu/oYNf+42kA6UhQKQGyrbjrDg0EtEJr/V5YyVxJ5SuAAYN8vVVfAalIRoJjUzJ8lD4hl hLDmuEmUB5KwZeGluegnaFNgnzt1rDeuRV1AM2qUj6FiJfLl68+X1CY63h/9AtJQU1vzt9tLZAl F+DPc7rx37AwZVWE7A4N6IxmVIzB4qC2geHZUn1ebX1HKdAz X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/keyboard/sh_keysc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c index 2c00320f739f..4ea4fd25c5d2 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c @@ -265,7 +265,7 @@ static int sh_keysc_probe(struct platform_device *pdev) return error; } -static int sh_keysc_remove(struct platform_device *pdev) +static void sh_keysc_remove(struct platform_device *pdev) { struct sh_keysc_priv *priv = platform_get_drvdata(pdev); @@ -279,8 +279,6 @@ static int sh_keysc_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); kfree(priv); - - return 0; } static int sh_keysc_suspend(struct device *dev) @@ -321,7 +319,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops, static struct platform_driver sh_keysc_device_driver = { .probe = sh_keysc_probe, - .remove = sh_keysc_remove, + .remove_new = sh_keysc_remove, .driver = { .name = "sh_keysc", .pm = pm_sleep_ptr(&sh_keysc_dev_pm_ops), From patchwork Wed Sep 20 12:57:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7BF2CE79D1 for ; Wed, 20 Sep 2023 12:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235831AbjITM7E (ORCPT ); Wed, 20 Sep 2023 08:59:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235155AbjITM65 (ORCPT ); Wed, 20 Sep 2023 08:58:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE8C9C2 for ; Wed, 20 Sep 2023 05:58:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-00059E-Ic; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwms-007gyt-3c; Wed, 20 Sep 2023 14:58:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmr-003ID5-Qe; Wed, 20 Sep 2023 14:58:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: ye xingchen , Jonathan Cameron , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 10/52] input: spear-keyboard - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:47 +0200 Message-Id: <20230920125829.1478827-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1824; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=c5aWaEYqw3pq0udrEFo1pDErFJD8qOiwYEQQIJqNZZI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuw+8TOBjEcrmdwXC+/wE23cwDEYfdcknECw6 qiONFvv4U+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsPgAKCRCPgPtYfRL+ Tm3mB/4lZ/kQzj4yWwGvWdlsNBfDLfkOVd661RznsmHwDo/PneIusInpJrO6bIiboIQ/VHCLRvu apU7O5unMyjPNy3wd916c4tOGjpTJVlL0dY9NMAyvQMrdpEM/lqyoAVfBq5j0dktx+w9BVOtZs1 kiXKv9CrJ2L0bYCyJPy/cdG8/MQ4lGduK7+opKQweGWAxA0klmcIDqj+MWQNkC/pM/NGWcqIw1n UDOuLXojAYdiXbscBoWe8Chhzt9BI/GeQo3iD0E6r+Lzsp1MLRYebCIKs7I4sBI9br1TVzQ1hFq pMrUpiRDnBP5kixjb4TLtGCa48lKYt5PToWUSxggO3XTlQNS X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/keyboard/spear-keyboard.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index a50fa9915381..557d00a667ce 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -272,14 +272,12 @@ static int spear_kbd_probe(struct platform_device *pdev) return 0; } -static int spear_kbd_remove(struct platform_device *pdev) +static void spear_kbd_remove(struct platform_device *pdev) { struct spear_kbd *kbd = platform_get_drvdata(pdev); input_unregister_device(kbd->input); clk_unprepare(kbd->clk); - - return 0; } static int spear_kbd_suspend(struct device *dev) @@ -375,7 +373,7 @@ MODULE_DEVICE_TABLE(of, spear_kbd_id_table); static struct platform_driver spear_kbd_driver = { .probe = spear_kbd_probe, - .remove = spear_kbd_remove, + .remove_new = spear_kbd_remove, .driver = { .name = "keyboard", .pm = pm_sleep_ptr(&spear_kbd_pm_ops), From patchwork Wed Sep 20 12:57:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B594CE79CE for ; Wed, 20 Sep 2023 12:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235571AbjITM7A (ORCPT ); Wed, 20 Sep 2023 08:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235957AbjITM6y (ORCPT ); Wed, 20 Sep 2023 08:58:54 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ACEA93 for ; Wed, 20 Sep 2023 05:58:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-0005AE-Ey; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwms-007gyw-B0; Wed, 20 Sep 2023 14:58:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwms-003ID9-1W; Wed, 20 Sep 2023 14:58:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Maxime Coquelin , Alexandre Torgue , linux-input@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 11/52] input: stmpe-keypad - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:48 +0200 Message-Id: <20230920125829.1478827-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1744; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hR+xfy5cJ6dkQ8th8pBh40l7WaCRGUsViNGV2Mb0oP4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxAplWQj00KiMIRQDHhuLJpAfB9dxrrVT5Qi HCoNwLauoKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsQAAKCRCPgPtYfRL+ TnyxCACOa3Ln2L7fKhv1S71rT7Xi+gXAvbFtnpOMbCCHO33VIBJTKMHwMAg01d2IAEYnHSeLhgZ v5GS6g1i6z0v/GXHNVv83e2G71qIuRIJTB9HVY1KgLdEIZXH1QjJ1TE6PYZYD1hkW2WL92SDV1C 5WXLA//ljN08rcqLK33uag/bJBr1Z/SVrCksTJTMXG+/Qd+Pal5tjn+uqxZxDhLDd3RGKUufXF8 mbn1RhjTuFzlxDWDrJrUjZbcLOXhCLKurRCNCxS4RT182h2cgVfiyAQb4721edfX42fiYcKbtAR tau1r4hnHajQbYlgdRIVlzkqEi9WHkG1d5qI1hSZzpTU79xm X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/keyboard/stmpe-keypad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c index 2c6c53290cc0..2013c0afd0c3 100644 --- a/drivers/input/keyboard/stmpe-keypad.c +++ b/drivers/input/keyboard/stmpe-keypad.c @@ -404,20 +404,18 @@ static int stmpe_keypad_probe(struct platform_device *pdev) return 0; } -static int stmpe_keypad_remove(struct platform_device *pdev) +static void stmpe_keypad_remove(struct platform_device *pdev) { struct stmpe_keypad *keypad = platform_get_drvdata(pdev); stmpe_disable(keypad->stmpe, STMPE_BLOCK_KEYPAD); - - return 0; } static struct platform_driver stmpe_keypad_driver = { .driver.name = "stmpe-keypad", .driver.owner = THIS_MODULE, .probe = stmpe_keypad_probe, - .remove = stmpe_keypad_remove, + .remove_new = stmpe_keypad_remove, }; module_platform_driver(stmpe_keypad_driver); From patchwork Wed Sep 20 12:57:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13939CE79CE for ; Wed, 20 Sep 2023 12:58:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234633AbjITM6z (ORCPT ); Wed, 20 Sep 2023 08:58:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236009AbjITM6v (ORCPT ); Wed, 20 Sep 2023 08:58:51 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 910AC185 for ; Wed, 20 Sep 2023 05:58:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwms-0005AF-VI; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwms-007gyz-Gf; Wed, 20 Sep 2023 14:58:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwms-003IDC-7F; Wed, 20 Sep 2023 14:58:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/52] input: 88pm80x_onkey - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:49 +0200 Message-Id: <20230920125829.1478827-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1823; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VdDT6oyta/rpqazxfou5Ka7SdQCrrjXJRR/uFSclTwg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxBPhIyiqzW1vbSI8fBEyoJy/0r7Wt3A57VL qr1eHkKQ3GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsQQAKCRCPgPtYfRL+ TlYqCACTMqpj0Fe/86QIxMXQ4Jx0S26hpS+5XmlnbpsBOuUBNaC9+aYjmorFUToegRvUcQAAMCe Y5xlNAx8BDz6Wy/Uki+hPWI/8Y1Ctihx3XbrZmuoclFf9krqQvSdahV0x0bwmVgbtZO0wNUFTiI XTskiLcXMBNN3+pnsduHAlgzZER5dXpVNKO2q5NnhXzxxewaRY9X+BmKXPtvAzthju4rowv6mJZ v1l9e7JGMXD2zzE2lNhA4PO55vUoRzuMaiMEpRe34uRLgU5vpCw4yshDGwfH+ktAZB505CnZhwS 3okjy66ZJbItSyWBp2Ni1WgX/2DrQ265MeL3s7O0gen/7Y7d X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/88pm80x_onkey.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c index 51c8a326fd06..31f0702c3d01 100644 --- a/drivers/input/misc/88pm80x_onkey.c +++ b/drivers/input/misc/88pm80x_onkey.c @@ -138,14 +138,13 @@ static int pm80x_onkey_probe(struct platform_device *pdev) return err; } -static int pm80x_onkey_remove(struct platform_device *pdev) +static void pm80x_onkey_remove(struct platform_device *pdev) { struct pm80x_onkey_info *info = platform_get_drvdata(pdev); pm80x_free_irq(info->pm80x, info->irq, info); input_unregister_device(info->idev); kfree(info); - return 0; } static struct platform_driver pm80x_onkey_driver = { @@ -154,7 +153,7 @@ static struct platform_driver pm80x_onkey_driver = { .pm = &pm80x_onkey_pm_ops, }, .probe = pm80x_onkey_probe, - .remove = pm80x_onkey_remove, + .remove_new = pm80x_onkey_remove, }; module_platform_driver(pm80x_onkey_driver); From patchwork Wed Sep 20 12:57:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392643 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9D5CCE79CF for ; Wed, 20 Sep 2023 12:58:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234773AbjITM65 (ORCPT ); Wed, 20 Sep 2023 08:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235304AbjITM6w (ORCPT ); Wed, 20 Sep 2023 08:58:52 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0AED18F for ; Wed, 20 Sep 2023 05:58:41 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-0005Aq-Bg; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwms-007gz2-Od; Wed, 20 Sep 2023 14:58:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwms-003IDG-Dh; Wed, 20 Sep 2023 14:58:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Support Opensource , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 13/52] input: da9052_onkey - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:50 +0200 Message-Id: <20230920125829.1478827-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1744; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CYtea/5iXmvSZD8QZvtwZYy8JgZfF2qpNQPTiee3UkM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxCK34o4B8z+GxA7CBSgj7Xoz62gBlRp2wtQ O75v3/D7sqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsQgAKCRCPgPtYfRL+ Tr4uCACzJc08yuVWV0GBcN7R2OPMCR4hfuvnLGTpCZ8PhVMNB5Ax/OlnH5ehQj46zfc5fwNY0qi IoFPA9rlo8yqene0EvlFcda7FqOe37RqXvus1WWYlCKTDpoPqNU9KOlY5vd6RayyJaT1KVZL60d QxLHZp8xwlL/FIlYB7VP7z1DWnVlRmMXp7xYwc1ZYM/cR2hW5pxlreX/JAH8H0/qy4iAK+hix0z YFZIulWLU+5V68FHpiWxd4iKzaCaGgv9+GQLRMCqXKupxLf8x3FftKpasB1zni6CLohbalvLks0 COniuu0HbhEKkI1OEpO8zdWRMklPZw+OA/cSJvxWCxCKEDTA X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/da9052_onkey.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/da9052_onkey.c b/drivers/input/misc/da9052_onkey.c index 6d1152850a6d..7a1122e1efb9 100644 --- a/drivers/input/misc/da9052_onkey.c +++ b/drivers/input/misc/da9052_onkey.c @@ -127,7 +127,7 @@ static int da9052_onkey_probe(struct platform_device *pdev) return error; } -static int da9052_onkey_remove(struct platform_device *pdev) +static void da9052_onkey_remove(struct platform_device *pdev) { struct da9052_onkey *onkey = platform_get_drvdata(pdev); @@ -136,13 +136,11 @@ static int da9052_onkey_remove(struct platform_device *pdev) input_unregister_device(onkey->input); kfree(onkey); - - return 0; } static struct platform_driver da9052_onkey_driver = { .probe = da9052_onkey_probe, - .remove = da9052_onkey_remove, + .remove_new = da9052_onkey_remove, .driver = { .name = "da9052-onkey", }, From patchwork Wed Sep 20 12:57:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 456FFCE79CE for ; Wed, 20 Sep 2023 12:58:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235304AbjITM66 (ORCPT ); Wed, 20 Sep 2023 08:58:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235699AbjITM6w (ORCPT ); Wed, 20 Sep 2023 08:58:52 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16837E4 for ; Wed, 20 Sep 2023 05:58:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-0005Ax-LT; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmt-007gz5-1a; Wed, 20 Sep 2023 14:58:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwms-003IDL-Nw; Wed, 20 Sep 2023 14:58:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Support Opensource , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/52] input: da9055_onkey - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:51 +0200 Message-Id: <20230920125829.1478827-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1840; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=QM9gXtqP0X7OAb2K3GCvSO/WliWvQQ7TO+EL1C0DG2s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxDJ1rxzXYZ5BoCrXCFYDJYFkmcK8PnyuWFn GsY4+R43TuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsQwAKCRCPgPtYfRL+ TtY+B/0anPO1fHvi4EkO1GcqFh2sNRKLSdfhuCSr0VLD/K57YAaFLYg+i6E3T0WjHlLb9I6TSBG oVQow6fXUQWHGxju9McjxPpRXPRRSzFn7W2xxANZDXYEWgZpk5b/CrZ85C0J1ODY6OI6nNv9DBa dQYaJLe6HP0/eWgP1XUdicV7gb3YYx2YNlHWUAgiamFt+SvNxy+F9Vvp4hKce0Tqv07joQUUxQW 7he4gP/r5cA1GSdCdjX9ysMgIEbYZahLfTUn+HEUy/VjJgqKMtc9HsGDSxvxo4RrakkNeGXErBd IatfgHsExRfZGaHjLTCSjf76Om0wTeNtHvNJa0WJWJtaIgew X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/da9055_onkey.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/da9055_onkey.c b/drivers/input/misc/da9055_onkey.c index 7a0d3a1d503c..871812f1b398 100644 --- a/drivers/input/misc/da9055_onkey.c +++ b/drivers/input/misc/da9055_onkey.c @@ -132,7 +132,7 @@ static int da9055_onkey_probe(struct platform_device *pdev) return err; } -static int da9055_onkey_remove(struct platform_device *pdev) +static void da9055_onkey_remove(struct platform_device *pdev) { struct da9055_onkey *onkey = platform_get_drvdata(pdev); int irq = platform_get_irq_byname(pdev, "ONKEY"); @@ -141,13 +141,11 @@ static int da9055_onkey_remove(struct platform_device *pdev) free_irq(irq, onkey); cancel_delayed_work_sync(&onkey->work); input_unregister_device(onkey->input); - - return 0; } static struct platform_driver da9055_onkey_driver = { .probe = da9055_onkey_probe, - .remove = da9055_onkey_remove, + .remove_new = da9055_onkey_remove, .driver = { .name = "da9055-onkey", }, From patchwork Wed Sep 20 12:57:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392642 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57D8CCE79D0 for ; Wed, 20 Sep 2023 12:58:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235574AbjITM64 (ORCPT ); Wed, 20 Sep 2023 08:58:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235679AbjITM6w (ORCPT ); Wed, 20 Sep 2023 08:58:52 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AC26E5 for ; Wed, 20 Sep 2023 05:58:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmt-0005Bl-TP; Wed, 20 Sep 2023 14:58:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmt-007gzA-BL; Wed, 20 Sep 2023 14:58:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwms-003IDO-VU; Wed, 20 Sep 2023 14:58:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Andrey Moiseev , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/52] input: ideapad_slidebar - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:52 +0200 Message-Id: <20230920125829.1478827-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1711; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=t/buwNUMTo9ACPKKsW7XuzXVT7i0LeDrcpWzGnDR+cg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxEZz+LaPU7suGswAFzul/K4Sph4q99WKxDV PxEq5p0gDqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsRAAKCRCPgPtYfRL+ TqkRCAC1m09dfmUAIEn/KbwUbzpVPw9G9adUbcpRyWhJHYzzdMGna0xndUXJrqOvAdX/t0p2ebl hBdpi3qLnytWb5JtQbymnEnwF4CqT/E/utOF1tYJLODeUOEFkcA3QYG7rlvHwOi0dQROnneoXKs lPMue7lZa/yRMWfXiQTWPOH28qT1gWpzrCElwGfHTVtjq/OFH/EvMqKH9k59bOF4GCO1qXQIgj2 tfxgqXQnAQfoFwOmpBPVg1rvHUWMJGzwuyFO+Y7lJ11isBKPaFj21jGkaFxwNEq69sYpN2WCxKg sVKoUlwQi62YQoYdkNFv2rpqaouoBkYIlPHLDF5sH1ZSpx4W X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/ideapad_slidebar.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/ideapad_slidebar.c b/drivers/input/misc/ideapad_slidebar.c index 68f1c584da05..fa4e7f67d713 100644 --- a/drivers/input/misc/ideapad_slidebar.c +++ b/drivers/input/misc/ideapad_slidebar.c @@ -256,20 +256,18 @@ static int __init ideapad_probe(struct platform_device* pdev) return err; } -static int ideapad_remove(struct platform_device *pdev) +static void ideapad_remove(struct platform_device *pdev) { i8042_remove_filter(slidebar_i8042_filter); input_unregister_device(slidebar_input_dev); release_region(IDEAPAD_BASE, 3); - - return 0; } static struct platform_driver slidebar_drv = { .driver = { .name = "ideapad_slidebar", }, - .remove = ideapad_remove, + .remove_new = ideapad_remove, }; static int __init ideapad_dmi_check(const struct dmi_system_id *id) From patchwork Wed Sep 20 12:57:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D67A3CE79D1 for ; Wed, 20 Sep 2023 12:58:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235699AbjITM66 (ORCPT ); Wed, 20 Sep 2023 08:58:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235709AbjITM6x (ORCPT ); Wed, 20 Sep 2023 08:58:53 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C446D194 for ; Wed, 20 Sep 2023 05:58:41 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmu-0005Cy-4z; Wed, 20 Sep 2023 14:58:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmt-007gzJ-Ir; Wed, 20 Sep 2023 14:58:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmt-003IDS-8D; Wed, 20 Sep 2023 14:58:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 16/52] input: m68kspkr - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:53 +0200 Message-Id: <20230920125829.1478827-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1770; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lf4rtaI/w6VSWNjNbo6KGWx/rFWLQqZd+jiz9vpR5yY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxFJFTl6HDnfGClQihUfudD8ovETAe/9LhRt a058MrKfJiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsRQAKCRCPgPtYfRL+ TqtKB/sGWsqWY+KTKJkSsm+WI81Do6ekZMb/9OovA2BRvYMQslO+RthPxHilu7Unm9mdx1X+w1j Y4AMkTasUc7viNlpteFzB4gWcn2upb5ED0gr+UC8roQgnGMgyvgZvp9pIjgVX4bzWrcBhP3NqtZ qDihLqmnxS90frR1lP28lLnxlYARLNycNURy1/23y6+WoAkvrHb10HiTo0uTljerGTCfTc89fgm 11VN5nNnNsWr8uQ7y09iPQY8MRe8E3MUBGwWHG/bS5Y4jgpQ2gIQEuCDk+6jbSBIJycyilXPqHQ vtgNRrc+Kevj9uKdhInhm2StBaiM+aQilSAXdGoAagwM/74V X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/m68kspkr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/m68kspkr.c b/drivers/input/misc/m68kspkr.c index 25fcf1467151..3fe0a85c45e0 100644 --- a/drivers/input/misc/m68kspkr.c +++ b/drivers/input/misc/m68kspkr.c @@ -75,15 +75,13 @@ static int m68kspkr_probe(struct platform_device *dev) return 0; } -static int m68kspkr_remove(struct platform_device *dev) +static void m68kspkr_remove(struct platform_device *dev) { struct input_dev *input_dev = platform_get_drvdata(dev); input_unregister_device(input_dev); /* turn off the speaker */ m68kspkr_event(NULL, EV_SND, SND_BELL, 0); - - return 0; } static void m68kspkr_shutdown(struct platform_device *dev) @@ -97,7 +95,7 @@ static struct platform_driver m68kspkr_platform_driver = { .name = "m68kspkr", }, .probe = m68kspkr_probe, - .remove = m68kspkr_remove, + .remove_new = m68kspkr_remove, .shutdown = m68kspkr_shutdown, }; From patchwork Wed Sep 20 12:57:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D0F1CE79D3 for ; Wed, 20 Sep 2023 12:59:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235933AbjITM7K (ORCPT ); Wed, 20 Sep 2023 08:59:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235957AbjITM7E (ORCPT ); Wed, 20 Sep 2023 08:59:04 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B21ED for ; Wed, 20 Sep 2023 05:58:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmu-0005EH-C4; Wed, 20 Sep 2023 14:58:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmt-007gzQ-SK; Wed, 20 Sep 2023 14:58:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmt-003IDX-J9; Wed, 20 Sep 2023 14:58:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Lee Jones , Linus Walleij , Jonathan Cameron , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/52] input: max8997_haptic - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:54 +0200 Message-Id: <20230920125829.1478827-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1920; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2DtF1NaX75+bn977z+QqWxhsiiwrjYCNN5DXyZUALwk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxG4/BQPZCszNyocVpkOzUzaV1igCA0JxBPK GoQqJgqC0OJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsRgAKCRCPgPtYfRL+ TumuB/9mwDWL9yH13V7E675PhtsjOT62RNQLxN4FPiSPx3xlPKCZKNETCWJyowQSYnM447rV4Ed ofkGJcSRSx9iDoZ6nzSLMuDBpxAJ7+3gank8xy+tYWp8sJyHFdsroFLGXuNmToocqKHlZshe/Uq TKmPuk2S4K1yuf20UtgsgynTe+9uolKok0TEt5ponKUTZuBCfnDKQ6J2XTiQfJALPSoejrLPcAe cNPT5NEC/mvrsRJVRnw5HFrQanjPV+U8khZWpRrP0DXHNxbJYywF/sOZ9XIK15huZ6hw2yogRdu 3jJ9qnTsHFCCaAqWAJGnIZM+lSlUYx+mf5VjEoHhqhwhEVlF X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/max8997_haptic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c index c4dff476d479..8861a67be575 100644 --- a/drivers/input/misc/max8997_haptic.c +++ b/drivers/input/misc/max8997_haptic.c @@ -351,7 +351,7 @@ static int max8997_haptic_probe(struct platform_device *pdev) return error; } -static int max8997_haptic_remove(struct platform_device *pdev) +static void max8997_haptic_remove(struct platform_device *pdev) { struct max8997_haptic *chip = platform_get_drvdata(pdev); @@ -362,8 +362,6 @@ static int max8997_haptic_remove(struct platform_device *pdev) pwm_put(chip->pwm); kfree(chip); - - return 0; } static int max8997_haptic_suspend(struct device *dev) @@ -391,7 +389,7 @@ static struct platform_driver max8997_haptic_driver = { .pm = pm_sleep_ptr(&max8997_haptic_pm_ops), }, .probe = max8997_haptic_probe, - .remove = max8997_haptic_remove, + .remove_new = max8997_haptic_remove, .id_table = max8997_haptic_id, }; module_platform_driver(max8997_haptic_driver); From patchwork Wed Sep 20 12:57:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08DB0CE79D0 for ; Wed, 20 Sep 2023 12:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235709AbjITM67 (ORCPT ); Wed, 20 Sep 2023 08:58:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235840AbjITM6x (ORCPT ); Wed, 20 Sep 2023 08:58:53 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16780E0 for ; Wed, 20 Sep 2023 05:58:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmu-0005Ew-GF; Wed, 20 Sep 2023 14:58:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmu-007gzU-1y; Wed, 20 Sep 2023 14:58:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmt-003IDb-P7; Wed, 20 Sep 2023 14:58:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 18/52] input: mc13783-pwrbutton - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:55 +0200 Message-Id: <20230920125829.1478827-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1861; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6jV3OqLKyaaesmy8yS6B0BVvd+w3baM67kGFQIsSRrw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxIwVcEzxYM5a/yJsIY3h/XVAAnqjzY4Iub9 TyASLqCsqSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsSAAKCRCPgPtYfRL+ TnZ7B/9ubSxKxlPwBNoIMQTDBE93nvv4kR/MWzTNzZCB318o1mmxl9+yMd11+zIW8JyCrjLLFD3 7WS6kH8hxcovQS7E4eDnsg6IGaPKLnbnoKxWVPI5+VDQdYxQZfgd7v1S6qIKNJeCNCPtwsPbQRw CM018SolV9b73Wa88WcKiBjfZAGcu9PvW/SyjXjSbNmhgHKhY93SYaATqVE+gmQA9/rA1UahLsG X2pOPSTrQfFxUmXDdUU2sk05e4/F3GrDSchYZMBc5UTDwfGAimqey4Sn+PRvMYtRqY93yt8c7Th 7kqSvqufQnPtmMaItupD9HaKh1R3f6Q40l4rcYMJS/SGnDL5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/mc13783-pwrbutton.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c index 0636eee4bb6c..1c8c939638f6 100644 --- a/drivers/input/misc/mc13783-pwrbutton.c +++ b/drivers/input/misc/mc13783-pwrbutton.c @@ -229,7 +229,7 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev) return err; } -static int mc13783_pwrbutton_remove(struct platform_device *pdev) +static void mc13783_pwrbutton_remove(struct platform_device *pdev) { struct mc13783_pwrb *priv = platform_get_drvdata(pdev); const struct mc13xxx_buttons_platform_data *pdata; @@ -249,13 +249,11 @@ static int mc13783_pwrbutton_remove(struct platform_device *pdev) input_unregister_device(priv->pwr); kfree(priv); - - return 0; } static struct platform_driver mc13783_pwrbutton_driver = { .probe = mc13783_pwrbutton_probe, - .remove = mc13783_pwrbutton_remove, + .remove_new = mc13783_pwrbutton_remove, .driver = { .name = "mc13783-pwrbutton", }, From patchwork Wed Sep 20 12:57:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 358DBCE79CE for ; Wed, 20 Sep 2023 12:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235913AbjITM7D (ORCPT ); Wed, 20 Sep 2023 08:59:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235976AbjITM6z (ORCPT ); Wed, 20 Sep 2023 08:58:55 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9FE7F5 for ; Wed, 20 Sep 2023 05:58:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmu-0005Fz-Md; Wed, 20 Sep 2023 14:58:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmu-007gzX-8b; Wed, 20 Sep 2023 14:58:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmt-003IDe-VZ; Wed, 20 Sep 2023 14:58:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Jonathan Cameron , Linus Walleij , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 19/52] input: palmas-pwrbutton - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:56 +0200 Message-Id: <20230920125829.1478827-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1899; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=NqJTNFOp0K7HQWAnzO99fRjaKvsa4IOFa8o1Oimtf88=; b=owEBbAGT/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxJr88rVmxYDbW5WeN+VAg9cOf7Npf3jOILe 77XgC3lg6mJATIEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsSQAKCRCPgPtYfRL+ TrF2B/irNn/cnw8ow8yjGclg6bqYeJ3xTwp8JG0g5OSOWQD68B/+QfgsfOZTgS/Ij0iQPjX0Cqk SSVRCgjrFJqdEdbdqqrkwL11Jw8chBMYUnch/m9cDCJDTEUr5eZyVotuefac+r64MiZ4XdL3CUf q4S1SS2RaW8CcVh4Wi1/urCRp/6CK1jMI/At1eslJezUuz9nc4QkUTAHr8ML8Z8pUIrnSWQXRwY X9MHdjFGJTGftHxi+6vfNmu1MEnU2uyeiKNUKVpus47Sq/x6MKbEQsuuXbMF8TS8WR06CutECBK CJRQkiNKmxzVJ0Dq8v01OeMnGVGJe27EPMNH5TlcjdJvKyU= X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/palmas-pwrbutton.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c index 7e361727b0d9..06d5972e8e84 100644 --- a/drivers/input/misc/palmas-pwrbutton.c +++ b/drivers/input/misc/palmas-pwrbutton.c @@ -245,7 +245,7 @@ static int palmas_pwron_probe(struct platform_device *pdev) * * Return: 0 */ -static int palmas_pwron_remove(struct platform_device *pdev) +static void palmas_pwron_remove(struct platform_device *pdev) { struct palmas_pwron *pwron = platform_get_drvdata(pdev); @@ -254,8 +254,6 @@ static int palmas_pwron_remove(struct platform_device *pdev) input_unregister_device(pwron->input_dev); kfree(pwron); - - return 0; } /** @@ -312,7 +310,7 @@ MODULE_DEVICE_TABLE(of, of_palmas_pwr_match); static struct platform_driver palmas_pwron_driver = { .probe = palmas_pwron_probe, - .remove = palmas_pwron_remove, + .remove_new = palmas_pwron_remove, .driver = { .name = "palmas_pwrbutton", .of_match_table = of_match_ptr(of_palmas_pwr_match), From patchwork Wed Sep 20 12:57:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C10ECE79D2 for ; Wed, 20 Sep 2023 12:58:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235048AbjITM7C (ORCPT ); Wed, 20 Sep 2023 08:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236090AbjITM6y (ORCPT ); Wed, 20 Sep 2023 08:58:54 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 683D4197 for ; Wed, 20 Sep 2023 05:58:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmu-0005GJ-QY; Wed, 20 Sep 2023 14:58:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmu-007gzb-Dk; Wed, 20 Sep 2023 14:58:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmu-003IDi-4k; Wed, 20 Sep 2023 14:58:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/52] input: pcap_keys - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:57 +0200 Message-Id: <20230920125829.1478827-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1716; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=NsnvjeEM0GTNhGElgcW9S6qu8vAW08o7AX/RLHShzfA=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSuN14rd6k0n0sJCr302l9sgRArs19Lw+HghmWi/Z8vJ KU7MWt0MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjARoXPsv1nOKr/PLTQS0yzd +/q2tnqA/O+aADf3DGtfMTPRaf/PZ3PITO+edeZki/DEMyznjGs6WXsvOC+Zd5/13KVNX1mmPT1 tsnaff0zcytarKm/qlzu1vf7+WHvel4YzzbxhX3QEHrbs4m5qjjhkkH0tTzvcp/VrsG8Jc83xzz 15W3J7Lm7V+s129WH7mqtRjOJPo1g36n5vlPZyV/6p6rvsnn7BmfJjlb3xNi3NGsWrLtgqXjmht P2psY7RVe2vGUesAgUan1xVcLgfE3eBiyf5hMHi340HTSRVTvN3BXIeOf+55NuNE55TOaQM5130 e3OvMjenfeeFXQ98I57P6Ir9drGvLXmFXvmRT5JLlctVAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/pcap_keys.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/pcap_keys.c b/drivers/input/misc/pcap_keys.c index b5a53636d7e2..8a7e9ada5952 100644 --- a/drivers/input/misc/pcap_keys.c +++ b/drivers/input/misc/pcap_keys.c @@ -99,7 +99,7 @@ static int pcap_keys_probe(struct platform_device *pdev) return err; } -static int pcap_keys_remove(struct platform_device *pdev) +static void pcap_keys_remove(struct platform_device *pdev) { struct pcap_keys *pcap_keys = platform_get_drvdata(pdev); @@ -108,13 +108,11 @@ static int pcap_keys_remove(struct platform_device *pdev) input_unregister_device(pcap_keys->input); kfree(pcap_keys); - - return 0; } static struct platform_driver pcap_keys_device_driver = { .probe = pcap_keys_probe, - .remove = pcap_keys_remove, + .remove_new = pcap_keys_remove, .driver = { .name = "pcap-keys", } From patchwork Wed Sep 20 12:57:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392648 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2462CE79CF for ; Wed, 20 Sep 2023 12:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234806AbjITM7A (ORCPT ); Wed, 20 Sep 2023 08:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235571AbjITM6x (ORCPT ); Wed, 20 Sep 2023 08:58:53 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D286199 for ; Wed, 20 Sep 2023 05:58:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmu-0005Ga-W1; Wed, 20 Sep 2023 14:58:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmu-007gzf-JT; Wed, 20 Sep 2023 14:58:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmu-003IDm-AK; Wed, 20 Sep 2023 14:58:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 21/52] input: pcf50633-input - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:58 +0200 Message-Id: <20230920125829.1478827-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1888; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=sk2uLRu8+Z7G4zHmL1tt9dM7sCETWMgmiwFLiN+GUKE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxL5JGI4Xs06Igvr9pN7fmfKxGYdKTG52Rb9 /lH1WYnpz2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsSwAKCRCPgPtYfRL+ TueWB/9e4OxvTp5BPkx66vTNp5u2lhmhQ1KdJwZ4MPmhXIYFK4HzkSA/LUdTrTY4qfFiRjme9FY fH5ovI5GouxhJijwbWpIZPBZ6SxpLOFO5LawV7ZC3lmPhkpw4rcByU8I9/rhbwCzc4yE75P7qIb FkPdbuVbSIwXVDy2nK4A0m8yy24G+Vznjkjn363vQ/6C0uBq8xELtPPxDqKhSODQ3nPZAcvVrDj tq/8Aeh+ON/I5K8s7X51OPofDeSFhHIBuugVC0DUgkxYEOaTkCGbfudIruLzCueO9rBklNX2Dam K5Cegg8RcnaTD/b8PZsVkABf3aKsYzWAk+7O8OmRez5uRazM X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/pcf50633-input.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c index 4c60c70c4c10..c5c5fe236c18 100644 --- a/drivers/input/misc/pcf50633-input.c +++ b/drivers/input/misc/pcf50633-input.c @@ -87,7 +87,7 @@ static int pcf50633_input_probe(struct platform_device *pdev) return 0; } -static int pcf50633_input_remove(struct platform_device *pdev) +static void pcf50633_input_remove(struct platform_device *pdev) { struct pcf50633_input *input = platform_get_drvdata(pdev); @@ -96,8 +96,6 @@ static int pcf50633_input_remove(struct platform_device *pdev) input_unregister_device(input->input_dev); kfree(input); - - return 0; } static struct platform_driver pcf50633_input_driver = { @@ -105,7 +103,7 @@ static struct platform_driver pcf50633_input_driver = { .name = "pcf50633-input", }, .probe = pcf50633_input_probe, - .remove = pcf50633_input_remove, + .remove_new = pcf50633_input_remove, }; module_platform_driver(pcf50633_input_driver); From patchwork Wed Sep 20 12:57:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EFEFCE79D3 for ; Wed, 20 Sep 2023 12:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235969AbjITM7D (ORCPT ); Wed, 20 Sep 2023 08:59:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235972AbjITM6z (ORCPT ); Wed, 20 Sep 2023 08:58:55 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D609E8 for ; Wed, 20 Sep 2023 05:58:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmv-0005H1-9N; Wed, 20 Sep 2023 14:58:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmu-007gzk-T2; Wed, 20 Sep 2023 14:58:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmu-003IDq-Jd; Wed, 20 Sep 2023 14:58:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 22/52] input: pcspkr - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:57:59 +0200 Message-Id: <20230920125829.1478827-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1782; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=RjV/fOJvcYA26YDjbKZ6eckVWDo+1/pWGVfTBVFSGuE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxMggHl+xh8fGNKhkvGdeyoJjuDeyxkK+KPe 1bR5CAnRU2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsTAAKCRCPgPtYfRL+ TrRICACCVglrT1/CxhR9HLrEN346UzBrJLsOynBBSxNqdSBbkJdQx2zOPWmPmtDzWYVtAm6hlxE mysS0SODqBt+HDxiv/xvMcXtw7Jzbw737iDTCrbBk+pymWeMPbEBvFJS/D/Xe2wHAqHltLOyxyA vS2nrtUEIZ7yJ7m03i3A9RL8flpeCIs+GTM5GPmRPTkdaENROk3zSkLP5yf/Ih7+/pGevCKgIpm V/ORvJ/LgqaUlKK/DH1ptCk9VPduMyeUWONUNm/WZGas2s9sNXNF8mXw4mHpdx0D5TXNE6zGq9R m328fNb7jaccdDQ/dr9MapUT/xEzRjnPRGpKfCdCrIJOQn5p X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/pcspkr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c index 9c666b2f14fe..897854fd245f 100644 --- a/drivers/input/misc/pcspkr.c +++ b/drivers/input/misc/pcspkr.c @@ -95,15 +95,13 @@ static int pcspkr_probe(struct platform_device *dev) return 0; } -static int pcspkr_remove(struct platform_device *dev) +static void pcspkr_remove(struct platform_device *dev) { struct input_dev *pcspkr_dev = platform_get_drvdata(dev); input_unregister_device(pcspkr_dev); /* turn off the speaker */ pcspkr_event(NULL, EV_SND, SND_BELL, 0); - - return 0; } static int pcspkr_suspend(struct device *dev) @@ -129,7 +127,7 @@ static struct platform_driver pcspkr_platform_driver = { .pm = &pcspkr_pm_ops, }, .probe = pcspkr_probe, - .remove = pcspkr_remove, + .remove_new = pcspkr_remove, .shutdown = pcspkr_shutdown, }; module_platform_driver(pcspkr_platform_driver); From patchwork Wed Sep 20 12:58:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C2F9CE79CF for ; Wed, 20 Sep 2023 12:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235572AbjITM7I (ORCPT ); Wed, 20 Sep 2023 08:59:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235869AbjITM7C (ORCPT ); Wed, 20 Sep 2023 08:59:02 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F36DD7 for ; Wed, 20 Sep 2023 05:58:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmv-0005Hn-FG; Wed, 20 Sep 2023 14:58:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmv-007gzo-2G; Wed, 20 Sep 2023 14:58:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmu-003IDv-PI; Wed, 20 Sep 2023 14:58:40 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/52] input: pm8941-pwrkey - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:00 +0200 Message-Id: <20230920125829.1478827-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1886; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+Cya8auCZYXraL2ZhN0lNfUtJzINrULP5iO4cvvhxkY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxNPW40yovhzJcSR0lMk0KO9b+523EEDrzU1 zycL+ecV7qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsTQAKCRCPgPtYfRL+ TlAiB/wIe4fGfnZLoRrKENZa9wq/NMRaW6bjGEyGeM38qc3zDjAbAcHkyJ76Bz0Zp2I6aju0ixY tBIAowUu+O2sWUsFqdKZF+PnOY6FA7drM7dkyHjHLGFVKpCjXBnKqEQF58sSqfwO6+kQkx5JVUn gwklSLYZgNSOou2TbepnjC9vFvaXeav8LiZ+d4W6SF+OIPcnC8B4TYSK/uA5mU2ldQ++gE/5A23 2G/c0dfSykFFHCNHAaBjpoHAjCpsvrHBbxPFUGJi4yBDesYMbFR9s6LKyXrR61pZ3p5lFYR0Hqt S5lXxMnNIonOQqVJ9nZQdS1eFQeS1iwNtqiLXm1+wKiTuwB/ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio --- drivers/input/misc/pm8941-pwrkey.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c index ba747c5b2b5f..bab710023d8f 100644 --- a/drivers/input/misc/pm8941-pwrkey.c +++ b/drivers/input/misc/pm8941-pwrkey.c @@ -408,14 +408,12 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) return 0; } -static int pm8941_pwrkey_remove(struct platform_device *pdev) +static void pm8941_pwrkey_remove(struct platform_device *pdev) { struct pm8941_pwrkey *pwrkey = platform_get_drvdata(pdev); if (pwrkey->data->supports_ps_hold_poff_config) unregister_reboot_notifier(&pwrkey->reboot_notifier); - - return 0; } static const struct pm8941_data pwrkey_data = { @@ -467,7 +465,7 @@ MODULE_DEVICE_TABLE(of, pm8941_pwr_key_id_table); static struct platform_driver pm8941_pwrkey_driver = { .probe = pm8941_pwrkey_probe, - .remove = pm8941_pwrkey_remove, + .remove_new = pm8941_pwrkey_remove, .driver = { .name = "pm8941-pwrkey", .pm = pm_sleep_ptr(&pm8941_pwr_key_pm_ops), From patchwork Wed Sep 20 12:58:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C55DFCE79D1 for ; Wed, 20 Sep 2023 12:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236027AbjITM7B (ORCPT ); Wed, 20 Sep 2023 08:59:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235445AbjITM6z (ORCPT ); Wed, 20 Sep 2023 08:58:55 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16969F9 for ; Wed, 20 Sep 2023 05:58:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmv-0005IQ-Lj; Wed, 20 Sep 2023 14:58:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmv-007gzs-8x; Wed, 20 Sep 2023 14:58:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmu-003IDz-W9; Wed, 20 Sep 2023 14:58:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Hans de Goede , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 24/52] input: soc_button_array - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:01 +0200 Message-Id: <20230920125829.1478827-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2025; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YmjGKkTPHuYKN4wdZRhWUzLBi3NLKI6aYICnJ852VXo=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSuN/6ppRGObw5apzKHxAcdSZn0/K3jvzTlR87Ff7rDe Nv33v3XyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBE5pxi/59dxFc/pZOn9fyJ lcWuxu3bU71e27Xt83370udMbJNn9aqJ+y7t0ReUko5bW8nK+Fq14RDrlgUT6zephipsE9yw/kP PZkaZQ9vDBOxTT3cdUzZe/KEhOFfhyjRj4f0Xvbs43MPWnVl2RfAg2yGrR0v0Trto7Hzjuq8uqE UnufN3wlcRz7xjchFW1cnidTPibqwNdFOfrlidyb9R7rv1xXVZWsJuh/TUasI0Jq4J5uf7orFou Xv+zbO77vCUOoedjFraW3o0rOue/MuljKceTMwOEdyq+HX614ccQnWpSobLNF2PGdXslz1t9VFi wyfvMMnXka68f6aeXtuxsaG29LqpEKOXsfR/g5DdSrwKAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/soc_button_array.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c index e79f5497948b..08bcee3d6bcc 100644 --- a/drivers/input/misc/soc_button_array.c +++ b/drivers/input/misc/soc_button_array.c @@ -411,7 +411,7 @@ static struct soc_button_info *soc_button_get_button_info(struct device *dev) return button_info; } -static int soc_button_remove(struct platform_device *pdev) +static void soc_button_remove(struct platform_device *pdev) { struct soc_button_data *priv = platform_get_drvdata(pdev); @@ -420,8 +420,6 @@ static int soc_button_remove(struct platform_device *pdev) for (i = 0; i < BUTTON_TYPES; i++) if (priv->children[i]) platform_device_unregister(priv->children[i]); - - return 0; } static int soc_button_probe(struct platform_device *pdev) @@ -609,7 +607,7 @@ MODULE_DEVICE_TABLE(acpi, soc_button_acpi_match); static struct platform_driver soc_button_driver = { .probe = soc_button_probe, - .remove = soc_button_remove, + .remove_new = soc_button_remove, .driver = { .name = KBUILD_MODNAME, .acpi_match_table = ACPI_PTR(soc_button_acpi_match), From patchwork Wed Sep 20 12:58:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E470CCE79D0 for ; Wed, 20 Sep 2023 12:58:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235596AbjITM7C (ORCPT ); Wed, 20 Sep 2023 08:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235969AbjITM6z (ORCPT ); Wed, 20 Sep 2023 08:58:55 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F56EC6 for ; Wed, 20 Sep 2023 05:58:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmv-0005Ih-R5; Wed, 20 Sep 2023 14:58:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmv-007gzw-ED; Wed, 20 Sep 2023 14:58:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmv-003IE2-4s; Wed, 20 Sep 2023 14:58:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Rob Herring , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/52] input: sparcspkr - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:02 +0200 Message-Id: <20230920125829.1478827-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2652; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oAueTscKRI8vCl8QQanTVPtmrT1p6TuiRwp4kOaCADI=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSuNwG8B/p7LeMUDmyPKDnqKTDbOlbpqfXZ45b2O8OaV izsv7Wik9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJRK9m/8l4WGgaz4Rah/3i 5a1qEyw8t7FvZn44PUnu5aONQbxB+t+r5qZEvWDiVty0zXeRxdovcVask5U1fzccynhg+KVz0Q/ XZtX078d3NszIL20rPF5txll9c3p77zIl9f/hzSstJRtLtbcZSYodN5ibo3/UwEvXdXr+/7LtFl 6Lzud5bgmYtvE+62G3mM9a9b82lXrlH334ZHaBytL4n80/4z79fb9kyhnHq8lLJht/qvv82vdku tFMC+HGDwXhZiLH1CNrVyhXt6zcvSpqIr+0X0ihSGnJTld5jfNSsY+ixXQ25k/iErl60E04bnJk uZS8+aMu5cJ5rppqBQ8eBVSsee/HLWY9e6duj9jnpYEuAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/sparcspkr.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c index e5dd84725c6e..20020cbc0752 100644 --- a/drivers/input/misc/sparcspkr.c +++ b/drivers/input/misc/sparcspkr.c @@ -231,7 +231,7 @@ static int bbc_beep_probe(struct platform_device *op) return err; } -static int bbc_remove(struct platform_device *op) +static void bbc_remove(struct platform_device *op) { struct sparcspkr_state *state = platform_get_drvdata(op); struct input_dev *input_dev = state->input_dev; @@ -245,8 +245,6 @@ static int bbc_remove(struct platform_device *op) of_iounmap(&op->resource[0], info->regs, 6); kfree(state); - - return 0; } static const struct of_device_id bbc_beep_match[] = { @@ -264,7 +262,7 @@ static struct platform_driver bbc_beep_driver = { .of_match_table = bbc_beep_match, }, .probe = bbc_beep_probe, - .remove = bbc_remove, + .remove_new = bbc_remove, .shutdown = sparcspkr_shutdown, }; @@ -310,7 +308,7 @@ static int grover_beep_probe(struct platform_device *op) return err; } -static int grover_remove(struct platform_device *op) +static void grover_remove(struct platform_device *op) { struct sparcspkr_state *state = platform_get_drvdata(op); struct grover_beep_info *info = &state->u.grover; @@ -325,8 +323,6 @@ static int grover_remove(struct platform_device *op) of_iounmap(&op->resource[2], info->freq_regs, 2); kfree(state); - - return 0; } static const struct of_device_id grover_beep_match[] = { @@ -344,7 +340,7 @@ static struct platform_driver grover_beep_driver = { .of_match_table = grover_beep_match, }, .probe = grover_beep_probe, - .remove = grover_remove, + .remove_new = grover_remove, .shutdown = sparcspkr_shutdown, }; From patchwork Wed Sep 20 12:58:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBE9DCE79CF for ; Wed, 20 Sep 2023 12:59:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235907AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235679AbjITM65 (ORCPT ); Wed, 20 Sep 2023 08:58:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF301AD for ; Wed, 20 Sep 2023 05:58:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmv-0005Iv-Vz; Wed, 20 Sep 2023 14:58:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmv-007h00-JA; Wed, 20 Sep 2023 14:58:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmv-003IE6-A9; Wed, 20 Sep 2023 14:58:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Miloslav Trmac , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 26/52] input: wistron_btns - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:03 +0200 Message-Id: <20230920125829.1478827-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Y689/ToQbZVEjELE6UCi7Qr7sB3Vy8O7iIGOkfPvpyE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxRwzCcTc0EGaBurqmX8DYo9lF6U62Q+Mk7b gUM1lQ4BH6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsUQAKCRCPgPtYfRL+ TtZnB/9rhh9DbqHFmis7tBoFBsHLMJ29Q8bIpP3CuPt6W0HulBjdpQWZgSNgqfOqGxvauP9dRqn yViff7LDiEd7VT9BEUO3rdJZTHXfU4U5oQNEIT3OFQYY9muQb4em+f0iHRFvrQ72/W6t2HTo0mm o1xfplWaXBKP3Rri9TNvfKi48XRMGowpLFP+9+6RwVCt2XuCa4DgMEGg9VvYZxe90PmFPQN7GeS po6VtOQHPuwouoBjE/TuRV2hfHn2YDc8LvgmAoiXXkaDDw66PKRWOlKSYUxhCTJIKuVTNEb6S0+ WGbifQ1TlMAKi6WTr9KMkatbjO92IYX9Sh/zPd/XK/mrkXL6 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/misc/wistron_btns.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c index 111cb70cde46..5c4956678cd0 100644 --- a/drivers/input/misc/wistron_btns.c +++ b/drivers/input/misc/wistron_btns.c @@ -1286,13 +1286,11 @@ static int wistron_probe(struct platform_device *dev) return 0; } -static int wistron_remove(struct platform_device *dev) +static void wistron_remove(struct platform_device *dev) { wistron_led_remove(); input_unregister_device(wistron_idev); bios_detach(); - - return 0; } static int wistron_suspend(struct device *dev) @@ -1336,7 +1334,7 @@ static struct platform_driver wistron_driver = { .pm = pm_sleep_ptr(&wistron_pm_ops), }, .probe = wistron_probe, - .remove = wistron_remove, + .remove_new = wistron_remove, }; static int __init wb_module_init(void) From patchwork Wed Sep 20 12:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392656 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22BB4CE79D0 for ; Wed, 20 Sep 2023 12:59:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235155AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235907AbjITM65 (ORCPT ); Wed, 20 Sep 2023 08:58:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A222EB for ; Wed, 20 Sep 2023 05:58:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmw-0005J9-5Q; Wed, 20 Sep 2023 14:58:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmv-007h03-P1; Wed, 20 Sep 2023 14:58:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmv-003IEA-FY; Wed, 20 Sep 2023 14:58:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: patches@opensource.cirrus.com, linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 27/52] input: wm831x-on - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:04 +0200 Message-Id: <20230920125829.1478827-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1679; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=gZQXYItcz9dC2SwCMhvQ+Td964wO5CgvcNX1T4i05e4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxSkPBHquZYF2rov+EcXNFW9bRRsNRVOPfwC NCoKHcG4WyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsUgAKCRCPgPtYfRL+ TurGB/9aOfQ/UOLvyQyJDt3sjWRAPo8Q+zZUjbDzInm01Wps1ke9iLapVo5OgBr5qkgUlc/gLzF Q0+blFGtj65jkGCw/u+OboiUfPv9uDzr8+CsLcu+25+dMtwb6EqELAwKlDXKo+lfpuwvWVMLwch VktwHwJ+j0KPOD5Qjv0jTI6hi+fXprz2BvX4db0SRxNZcoXTrEbVpYETV1a22FU8naqOqIx4LXL xWinLtBkiNCiV7Y5UK35gNPI6q4RVboYQXLwK9Tcyl6nf6RZGII1eJVpQOFGlEcokQtsOyXg/GW EMB0dHln+rG4a8v1LTDyr8lRUrjWLRJuSnuyBnfb1U2pjeeE X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Charles Keepax --- drivers/input/misc/wm831x-on.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c index a42fe041b73c..e4a06c73b72d 100644 --- a/drivers/input/misc/wm831x-on.c +++ b/drivers/input/misc/wm831x-on.c @@ -123,20 +123,18 @@ static int wm831x_on_probe(struct platform_device *pdev) return ret; } -static int wm831x_on_remove(struct platform_device *pdev) +static void wm831x_on_remove(struct platform_device *pdev) { struct wm831x_on *wm831x_on = platform_get_drvdata(pdev); int irq = platform_get_irq(pdev, 0); free_irq(irq, wm831x_on); cancel_delayed_work_sync(&wm831x_on->work); - - return 0; } static struct platform_driver wm831x_on_driver = { .probe = wm831x_on_probe, - .remove = wm831x_on_remove, + .remove_new = wm831x_on_remove, .driver = { .name = "wm831x-on", }, From patchwork Wed Sep 20 12:58:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE2CCCE79D0 for ; Wed, 20 Sep 2023 12:59:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235290AbjITM7H (ORCPT ); Wed, 20 Sep 2023 08:59:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235812AbjITM67 (ORCPT ); Wed, 20 Sep 2023 08:58:59 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C9E4122 for ; Wed, 20 Sep 2023 05:58:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmw-0005JU-CC; Wed, 20 Sep 2023 14:58:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmv-007h08-Ve; Wed, 20 Sep 2023 14:58:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmv-003IEF-MW; Wed, 20 Sep 2023 14:58:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Jonathan Cameron , Linus Walleij , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/52] input: navpoint - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:05 +0200 Message-Id: <20230920125829.1478827-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1878; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=3AQRc2nNT2SkdX2eRxLRmjZGWiHn4Xb2m6xzSSPLTUE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxTdKj5BUEJUuCD5Xd/qLKKmU2tB8FKadnx+ HO1zts54guJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsUwAKCRCPgPtYfRL+ Tqq8B/42RX29NdVfQBExb1OqsUN5FY1QfQEkVR7mqxb9QuoDgMZgPxlFlseodfLEGYt68wtaopO vidz2D/uSzRofVG/Hjt/OSm2XK3gSBWWBPvOw57+mjjlrG4ONN52bhiFlXGvxA6Mpy1WaPN7kpD fEng08qL3HuFFD3PajFsFRNkv+WR/Of+L5Dky+7x1t3XjkmrlnLP6tbcoyPMHJdEr6GF4ymjAYX eTbtxnPw2D0Q28wy5IszmS4Du4JUTrIkzH9e7T88E3qWZ/52jmEAvhLnaKSue37ArsjQdOZ4Zsq 8Y52n2J5btNrt7O8oxALHn9QjqcrxpSwWYYXAl/SKrrm4s6e X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/mouse/navpoint.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/mouse/navpoint.c b/drivers/input/mouse/navpoint.c index 2b7b86eef280..c00dc1275da2 100644 --- a/drivers/input/mouse/navpoint.c +++ b/drivers/input/mouse/navpoint.c @@ -295,7 +295,7 @@ static int navpoint_probe(struct platform_device *pdev) return error; } -static int navpoint_remove(struct platform_device *pdev) +static void navpoint_remove(struct platform_device *pdev) { const struct navpoint_platform_data *pdata = dev_get_platdata(&pdev->dev); @@ -311,8 +311,6 @@ static int navpoint_remove(struct platform_device *pdev) if (gpio_is_valid(pdata->gpio)) gpio_free(pdata->gpio); - - return 0; } static int navpoint_suspend(struct device *dev) @@ -348,7 +346,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(navpoint_pm_ops, static struct platform_driver navpoint_driver = { .probe = navpoint_probe, - .remove = navpoint_remove, + .remove_new = navpoint_remove, .driver = { .name = "navpoint", .pm = pm_sleep_ptr(&navpoint_pm_ops), From patchwork Wed Sep 20 12:58:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F37CCE79D2 for ; Wed, 20 Sep 2023 12:59:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235972AbjITM7G (ORCPT ); Wed, 20 Sep 2023 08:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236009AbjITM65 (ORCPT ); Wed, 20 Sep 2023 08:58:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D56C119 for ; Wed, 20 Sep 2023 05:58:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmw-0005Je-H3; Wed, 20 Sep 2023 14:58:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmw-007h0C-4V; Wed, 20 Sep 2023 14:58:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmv-003IEI-RW; Wed, 20 Sep 2023 14:58:41 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: ye xingchen , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 29/52] input: altera_ps2 - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:06 +0200 Message-Id: <20230920125829.1478827-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1772; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=b/cELWNx+24F9jzjVbrLYR4moeHDu3AcRzHmcIjFvR8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxU2aqAcGE7S0GFklYbztKYBArJiliaOJS1b mPPbHTiqmiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsVAAKCRCPgPtYfRL+ TlT4CACtJBJPeyuiyyEs3mlsYwLYxL5BDHmy7s0N0t3Mc/ko+7f5RlznhYwISw78Wb04PrjtMxr SDHir511ii4SD9upLz8HZ6nDZI68TcFPnjCyUVYCsDaDGqI1xdnGGdRQUKgymLW9GaxeSQGBdTh 0mXymGOSsvzt7gxpdj+OFkk1HX2GQcJ4i//gX+6Lz5ODJS/N9OhjDQ/Yo3WH955uF/LAFHcz/tR fgOCzT/mZ4m19/cb26HYVK2nFL4uIoknz5N0FHv6ZdYa1GJ5bx9ttPWiCkCaI5fubnDhyEBebOW 3zEJXhT7OmsPqTefe3t56cakabpyD/48L5Bd4EkZEPkfYqxM X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/altera_ps2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c index 9f8d7b332d1b..c5b634940cfc 100644 --- a/drivers/input/serio/altera_ps2.c +++ b/drivers/input/serio/altera_ps2.c @@ -125,13 +125,11 @@ static int altera_ps2_probe(struct platform_device *pdev) /* * Remove one device from this driver. */ -static int altera_ps2_remove(struct platform_device *pdev) +static void altera_ps2_remove(struct platform_device *pdev) { struct ps2if *ps2if = platform_get_drvdata(pdev); serio_unregister_port(ps2if->io); - - return 0; } #ifdef CONFIG_OF @@ -148,7 +146,7 @@ MODULE_DEVICE_TABLE(of, altera_ps2_match); */ static struct platform_driver altera_ps2_driver = { .probe = altera_ps2_probe, - .remove = altera_ps2_remove, + .remove_new = altera_ps2_remove, .driver = { .name = DRV_NAME, .of_match_table = of_match_ptr(altera_ps2_match), From patchwork Wed Sep 20 12:58:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CC2CCE79D3 for ; Wed, 20 Sep 2023 12:59:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236165AbjITM7H (ORCPT ); Wed, 20 Sep 2023 08:59:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235290AbjITM67 (ORCPT ); Wed, 20 Sep 2023 08:58:59 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D0E319D for ; Wed, 20 Sep 2023 05:58:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmx-0005M9-3v; Wed, 20 Sep 2023 14:58:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmw-007h0H-JM; Wed, 20 Sep 2023 14:58:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmw-003IEM-AB; Wed, 20 Sep 2023 14:58:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 30/52] input: ams_delta_serio - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:07 +0200 Message-Id: <20230920125829.1478827-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1664; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=k4RLsXMFvCHnBLWmbBjnDnZVO2FI6ukTajpbodF2N5E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxVCmdSD7izreR5w2xmw2r0Fc8fe3Ih5cUAE pLhBY1n/h2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsVQAKCRCPgPtYfRL+ ToZ6B/0VDI1VHr5OzdCsZStAZnpDgUnHj9L7Wwv+rYlmt4LGZf3D/WcykI3OmGDEV94B87C6pQL T5XxP5frQE8KGtKhqHpATg/UTK7HgXWyUjyABaRh1WJuPH6xxOBtbiQaedGT+4xWLm1kKuaFakr 0/1BX0tzJm98ETCIfdI0qjFGGnN+MhngsYxxntEzqB5sWGfiDkSlQwpM/zBSYfY7lwZr0CQlhfB ZX0sEhY+AoskBdHob+ftRBBofuHB5C+lLdMUXeSNrRlP60B1c0Z3WaNPQDQ5fj7HoTD/0JTDMaF MI4/YGgVihooX/RLLH9PURUZDCi2qzclnULiECqYNnLFrNd2 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/ams_delta_serio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index ec93cb4573c3..0bd6ae106809 100644 --- a/drivers/input/serio/ams_delta_serio.c +++ b/drivers/input/serio/ams_delta_serio.c @@ -173,18 +173,16 @@ static int ams_delta_serio_init(struct platform_device *pdev) return 0; } -static int ams_delta_serio_exit(struct platform_device *pdev) +static void ams_delta_serio_exit(struct platform_device *pdev) { struct ams_delta_serio *priv = platform_get_drvdata(pdev); serio_unregister_port(priv->serio); - - return 0; } static struct platform_driver ams_delta_serio_driver = { .probe = ams_delta_serio_init, - .remove = ams_delta_serio_exit, + .remove_new = ams_delta_serio_exit, .driver = { .name = DRIVER_NAME }, From patchwork Wed Sep 20 12:58:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 420E4CE79CF for ; Wed, 20 Sep 2023 12:59:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235992AbjITM7P (ORCPT ); Wed, 20 Sep 2023 08:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236224AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 559B68F for ; Wed, 20 Sep 2023 05:58:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmx-0005NW-Gk; Wed, 20 Sep 2023 14:58:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmw-007h0L-PV; Wed, 20 Sep 2023 14:58:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmw-003IER-G3; Wed, 20 Sep 2023 14:58:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Rob Herring , ye xingchen , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 31/52] input: apbps2 - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:08 +0200 Message-Id: <20230920125829.1478827-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1715; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uM3xnUriNMhL6Hc4uF1BY04iIO0JvSpY6xt5ozx9fbI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxXRn0YU4GkZm14DLiyc7+ZYtL/6unVWbBzM Wms7CkFZeiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsVwAKCRCPgPtYfRL+ TniXCACFz32ZJHEmh7sGSmcCwzGCUHX/qYJ1LBXPkaHL5XNo5KHD2JhXlUCv8dYAarEkbatQzPU B4sY4/c0AEzrMaJqVci1vvmPlzJ7O2qVMk8wRaPLRLFyjHQVA6brOyot7ujrGnMhoaPQAJxpuwA NZnnyMEmzikVquGkQvB6SXgog3hos/sq485I3xw4vKzS2gNf8h/WhYrsn7jCGckdGK/Y6amk5+W cRfbwRqwlEHttyYDI2uBvA5x6pCMgzFbSMbL1JMlXCH24dcSNaclLG4kPVdKCCKChWoPYi2Olyl NDZxl5d+JxLg6FR2vYTEHtJtDsmll3/AsWLmF7kOKIhOYtrG X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/apbps2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c index 3f6866d39b86..dbbb10251520 100644 --- a/drivers/input/serio/apbps2.c +++ b/drivers/input/serio/apbps2.c @@ -187,13 +187,11 @@ static int apbps2_of_probe(struct platform_device *ofdev) return 0; } -static int apbps2_of_remove(struct platform_device *of_dev) +static void apbps2_of_remove(struct platform_device *of_dev) { struct apbps2_priv *priv = platform_get_drvdata(of_dev); serio_unregister_port(priv->io); - - return 0; } static const struct of_device_id apbps2_of_match[] = { @@ -210,7 +208,7 @@ static struct platform_driver apbps2_of_driver = { .of_match_table = apbps2_of_match, }, .probe = apbps2_of_probe, - .remove = apbps2_of_remove, + .remove_new = apbps2_of_remove, }; module_platform_driver(apbps2_of_driver); From patchwork Wed Sep 20 12:58:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392664 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A65CFCE79CE for ; Wed, 20 Sep 2023 12:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235976AbjITM7J (ORCPT ); Wed, 20 Sep 2023 08:59:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235445AbjITM7C (ORCPT ); Wed, 20 Sep 2023 08:59:02 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F8041AA for ; Wed, 20 Sep 2023 05:58:47 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmx-0005PD-Qf; Wed, 20 Sep 2023 14:58:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmx-007h0O-0G; Wed, 20 Sep 2023 14:58:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmw-003IEX-NF; Wed, 20 Sep 2023 14:58:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: ye xingchen , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 32/52] input: arc_ps2 - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:09 +0200 Message-Id: <20230920125829.1478827-33-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1878; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7X8uCrMOxU8K8IY7e7GStE3Jj6HCWLqRoi2Yd+ba3bk=; b=owEBbAGT/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxY2s4o+BRlx1jHH9//0fAUDYdOSnX4sju+O Vod2sIFPRqJATIEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsWAAKCRCPgPtYfRL+ TpfEB/MG7oNID/tu31FaFDAWzBc9skt9hQuObENvHmRoMxyluviYQptM53V9uei5/YzVYPZUXx4 VpPBG7ClmKUjomR+nbKp/ReKQqdM4ns7QyQaeeW5hnKBFI2Na/NZLuAlsvCKbnBItnMCsvvCcOB VsrwgyIaEY9UqNCI1a2DXepo9Sq4KVGYOJ5HxDJXlVZHXoxlMsSflZ763Nns6ZBhK26ohMmVUFz w/aGc3BN9kvcB50N/sNxe8Bi04R9WiBfZ00eEMe7mGSVgMGrjUAs7DgpQUNEiajaU4SGqL9rAEB o9DRbqmQ6hIvrzRl2VxY6mt5d7hcdPGD7Z8xsqkgyjZhKbU= X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/arc_ps2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/arc_ps2.c b/drivers/input/serio/arc_ps2.c index a6debb13d527..9d8726830140 100644 --- a/drivers/input/serio/arc_ps2.c +++ b/drivers/input/serio/arc_ps2.c @@ -232,7 +232,7 @@ static int arc_ps2_probe(struct platform_device *pdev) return 0; } -static int arc_ps2_remove(struct platform_device *pdev) +static void arc_ps2_remove(struct platform_device *pdev) { struct arc_ps2_data *arc_ps2 = platform_get_drvdata(pdev); int i; @@ -244,8 +244,6 @@ static int arc_ps2_remove(struct platform_device *pdev) dev_dbg(&pdev->dev, "frame error count = %i\n", arc_ps2->frame_error); dev_dbg(&pdev->dev, "buffer overflow count = %i\n", arc_ps2->buf_overflow); - - return 0; } #ifdef CONFIG_OF @@ -262,7 +260,7 @@ static struct platform_driver arc_ps2_driver = { .of_match_table = of_match_ptr(arc_ps2_match), }, .probe = arc_ps2_probe, - .remove = arc_ps2_remove, + .remove_new = arc_ps2_remove, }; module_platform_driver(arc_ps2_driver); From patchwork Wed Sep 20 12:58:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FDE8CE79D1 for ; Wed, 20 Sep 2023 12:59:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235812AbjITM7I (ORCPT ); Wed, 20 Sep 2023 08:59:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235572AbjITM7C (ORCPT ); Wed, 20 Sep 2023 08:59:02 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59751133 for ; Wed, 20 Sep 2023 05:58:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmx-0005Qi-Un; Wed, 20 Sep 2023 14:58:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmx-007h0R-74; Wed, 20 Sep 2023 14:58:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmw-003IEb-U5; Wed, 20 Sep 2023 14:58:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Christophe JAILLET , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 33/52] input: ct82c710 - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:10 +0200 Message-Id: <20230920125829.1478827-34-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1592; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ItH+0WRyjZ/ukPbYKT4JATm3dReP/LejSq4QWeVXTJ4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxZBZuOtJ9xbe3a9i8VphLd2KNsoX9nrIY85 sdwSicjiQGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsWQAKCRCPgPtYfRL+ TuB8B/0fWJdV+duCvgUDAQ2n2LiknL+qH6xLCLvTIfogBvmaBtypy3OSEixUKVByLJESA3oTe16 fCf3f68IWz9U4jWVDaBfyr3eVVKuW7p7qdC6a2exscAVZzL64tcyMWXvoh2/OABoJYbpwI/na3M K0Qw8PXYtgO1ZH0WfbUBC5l54UecZrRiu3uW3vugRm/8Xbl8Wt+iOV4nJ/9zv/SLhMNQTCohRL4 r3HkNEl6LYcMWDfivYBu0Dy1AybQymEvASX8j/sA1kCM0LtGUyvzsFPAr0fv/JeDVrXuFrSYmUD rgosGTb95+QPENTPZOyT044z2s+k6UW0LqNwCpkS2Wx/+C4u X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/ct82c710.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c index 3da751f4a6bf..d5c9bb3d0103 100644 --- a/drivers/input/serio/ct82c710.c +++ b/drivers/input/serio/ct82c710.c @@ -180,11 +180,9 @@ static int ct82c710_probe(struct platform_device *dev) return 0; } -static int ct82c710_remove(struct platform_device *dev) +static void ct82c710_remove(struct platform_device *dev) { serio_unregister_port(ct82c710_port); - - return 0; } static struct platform_driver ct82c710_driver = { @@ -192,7 +190,7 @@ static struct platform_driver ct82c710_driver = { .name = "ct82c710", }, .probe = ct82c710_probe, - .remove = ct82c710_remove, + .remove_new = ct82c710_remove, }; From patchwork Wed Sep 20 12:58:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E81D2CE79D1 for ; Wed, 20 Sep 2023 12:59:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236160AbjITM7R (ORCPT ); Wed, 20 Sep 2023 08:59:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236153AbjITM7H (ORCPT ); Wed, 20 Sep 2023 08:59:07 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 104B0B6 for ; Wed, 20 Sep 2023 05:58:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmy-0005Sm-Dv; Wed, 20 Sep 2023 14:58:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmx-007h0V-Cx; Wed, 20 Sep 2023 14:58:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmx-003IEf-3k; Wed, 20 Sep 2023 14:58:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Rob Herring , Liang He , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 34/52] drivers/input/serio/i8042-sparcio.h :: Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:11 +0200 Message-Id: <20230920125829.1478827-35-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1691; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bguHYNAbW0JHfcHAlaOD0UMgUkVnGF3h4uEIBcS7buU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxaCp/ffrkPyj63s+7uKo9rTudeMDyxXjfy7 9WGpdyEDjuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsWgAKCRCPgPtYfRL+ TlV1CACpjFOT8mrF71juA6+GWd/WW9RUGh5rCRChIw/QuCY/HYh585mON22EQxLP6QEAC4qpIag TTQ8wa6p+jmJjcIfDOpLMXN0KGyMWp2Dy2bFbliJtsfP21NXT59DmwUuDIG29vEMMYf+EHI9g1x 0ts21VPu1gOYuLAqdipWxtps0m5cjnepLY3K4UfGMTwur9e6soQOqTFt1wSP7ewfEf4nBb6djjm 79AnL1+/t13kTtu+XShc+CER5hHP2InS9DXvBBm9rwBf4392lt2NvyRYFcnn08TcVf0uz0t6RDh Myr2hzYK/DqhhvrvBFO6Uk37T17aLjUkM4+BCP13dbURySBR X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/i8042-sparcio.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h index b68793bf05c8..c2fda54dc384 100644 --- a/drivers/input/serio/i8042-sparcio.h +++ b/drivers/input/serio/i8042-sparcio.h @@ -82,11 +82,9 @@ static int sparc_i8042_probe(struct platform_device *op) return 0; } -static int sparc_i8042_remove(struct platform_device *op) +static void sparc_i8042_remove(struct platform_device *op) { of_iounmap(kbd_res, kbd_iobase, 8); - - return 0; } static const struct of_device_id sparc_i8042_match[] = { @@ -103,7 +101,7 @@ static struct platform_driver sparc_i8042_driver = { .of_match_table = sparc_i8042_match, }, .probe = sparc_i8042_probe, - .remove = sparc_i8042_remove, + .remove_new = sparc_i8042_remove, }; static bool i8042_is_mr_coffee(void) From patchwork Wed Sep 20 12:58:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56E54CE79D0 for ; Wed, 20 Sep 2023 12:59:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235445AbjITM7J (ORCPT ); Wed, 20 Sep 2023 08:59:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235933AbjITM7C (ORCPT ); Wed, 20 Sep 2023 08:59:02 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A2D31B1 for ; Wed, 20 Sep 2023 05:58:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmy-0005TE-RC; Wed, 20 Sep 2023 14:58:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmx-007h0X-Jw; Wed, 20 Sep 2023 14:58:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmx-003IEj-AM; Wed, 20 Sep 2023 14:58:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Chen Jun , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 35/52] input: i8042 - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:12 +0200 Message-Id: <20230920125829.1478827-36-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1619; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qXFfmH9ohm6YIWOIaXdw0iN10nBymRGUnLiv5qGF5ZE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxbvrUAESrEhv8qOI0YBUiNY6Lj9oaVZIADM fHVbA2jt6uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsWwAKCRCPgPtYfRL+ Tr9sB/4+SrkNcESUVlrcOfXjnsStfMPu+29rghBRx6L+L/tKzmOwQGucQ0HuT8wKtdNw4UMoo35 7KE5tE7DO+oPe0ovnjekEDOUyIkPVngOIwbs5npgxB2L4npd8hF3HhWkolB6GMCuiS9XogeYLhb e3CLt9foCqzJ4GlBRsW/EYZjVDlIDXaLhwqtnS87FmibF8ouUUfJ7jdvElH61UD6fzqS4CnuxYB MdH3ZGlE55mo0ixxdgtoaejuPW0uSPxQeAHIZk4q5n5U5RBELEQtxOodajnD6GKxTdwzsJbAfch ashdU1MKRPlAVgqcpOyYKUQwAvJRIwNnHMUHHccL8jdEDKfS X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/i8042.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 6dac7c1853a5..9fbb8d31575a 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -1584,13 +1584,11 @@ static int i8042_probe(struct platform_device *dev) return error; } -static int i8042_remove(struct platform_device *dev) +static void i8042_remove(struct platform_device *dev) { i8042_unregister_ports(); i8042_free_irqs(); i8042_controller_reset(false); - - return 0; } static struct platform_driver i8042_driver = { @@ -1601,7 +1599,7 @@ static struct platform_driver i8042_driver = { #endif }, .probe = i8042_probe, - .remove = i8042_remove, + .remove_new = i8042_remove, .shutdown = i8042_shutdown, }; From patchwork Wed Sep 20 12:58:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46B15CE79D2 for ; Wed, 20 Sep 2023 12:59:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235957AbjITM7L (ORCPT ); Wed, 20 Sep 2023 08:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235992AbjITM7E (ORCPT ); Wed, 20 Sep 2023 08:59:04 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF4B41B2 for ; Wed, 20 Sep 2023 05:58:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmz-0005VL-6E; Wed, 20 Sep 2023 14:58:45 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmx-007h0c-UI; Wed, 20 Sep 2023 14:58:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmx-003IEm-Ko; Wed, 20 Sep 2023 14:58:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 36/52] input: ioc3kbd - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:13 +0200 Message-Id: <20230920125829.1478827-37-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1702; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MSB+wtL3GLAWTM1wsCxPsyNriJgyi0G0vzMveo2gbss=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxcxLXVfofN8NbkKGgWH3o5Jpa+gG+gUORN0 xohi/CT4XSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsXAAKCRCPgPtYfRL+ TmqjB/0XszIMET2FiaGVZSHZoWLQWNBZ7frHOdIyh9PVUFkK4eV5j0Pz9MStNDG96cMj95anI+j ysQShooB1Fvdd4PS/Dax6yT+JVCDp+2FJA2fp2m/7IXslYwYx2XYuZEGy88X0PLOkY+znSIq9/U Nt0UVYyojOZCnLCu16ZXs/HxdNqRZm/cQnsZ/1OvE+jngygeptMolJmRS0FNcu3wHcX5FdIQg8Y Dy4siejXlNsaSQCCHSsJVpnLNwWQtCJ15/kY9Q43D3PWLhkDQGw6LFKBJfF70XFjvDRoQuQ9NX4 xF+FIvF1R27hXBY21p3oyaGMrjdzyNXDFUv2r27aX9JbIuRw X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/ioc3kbd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/ioc3kbd.c b/drivers/input/serio/ioc3kbd.c index d51bfe912db5..50552dc7b4f5 100644 --- a/drivers/input/serio/ioc3kbd.c +++ b/drivers/input/serio/ioc3kbd.c @@ -190,7 +190,7 @@ static int ioc3kbd_probe(struct platform_device *pdev) return 0; } -static int ioc3kbd_remove(struct platform_device *pdev) +static void ioc3kbd_remove(struct platform_device *pdev) { struct ioc3kbd_data *d = platform_get_drvdata(pdev); @@ -198,13 +198,11 @@ static int ioc3kbd_remove(struct platform_device *pdev) serio_unregister_port(d->kbd); serio_unregister_port(d->aux); - - return 0; } static struct platform_driver ioc3kbd_driver = { .probe = ioc3kbd_probe, - .remove = ioc3kbd_remove, + .remove_new = ioc3kbd_remove, .driver = { .name = "ioc3-kbd", }, From patchwork Wed Sep 20 12:58:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C40F0CE79CF for ; Wed, 20 Sep 2023 12:59:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235980AbjITM7M (ORCPT ); Wed, 20 Sep 2023 08:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236004AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D98111B4 for ; Wed, 20 Sep 2023 05:58:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmz-0005W3-Fo; Wed, 20 Sep 2023 14:58:45 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmy-007h0g-6R; Wed, 20 Sep 2023 14:58:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmx-003IEr-Rv; Wed, 20 Sep 2023 14:58:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 37/52] input: maceps2 - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:14 +0200 Message-Id: <20230920125829.1478827-38-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1660; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=V5YRacUM0Bi6N1Z2rinocnOXvhtc6fxpBW2BYO3nGi8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxe+FIiC4zMOIZFUJ46BRfXqxqNkfFvELg8a i0ZjJ7s266JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsXgAKCRCPgPtYfRL+ ThUwB/9ZNyPHCim5uKP63AvAbzod431/C90gU+ak/Ohl9lOgxqMFwwDcrN7f+NtrBgAGP7QW4dR ur2U7dx8Htk4CEmtuhd7vJzEme8IP1Xvv2mB4siDIP4QIYJOfhJxFM8bABEDVqts4ePxnqo8dnq 1JJenV5xzdPzAt8kYSWcFwF8/3znXyZMEuLE8YOXQhT6wqlQ0XafKVotNSSuI9ozGCMHnF3OB3y FqHIZYipF5vHspSy1pQmq/yR34Lz3xmDis4q3y1Or1yL4XXc3eNslTB5jrshHa2PwxZ3MxUF2+g QTfm9/ohk7gTxTm7/U+jNc/o7+xtSSSnfZjjE3Ir8xjPHYPz X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/maceps2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c index 629e15089c21..5ccfb82759b3 100644 --- a/drivers/input/serio/maceps2.c +++ b/drivers/input/serio/maceps2.c @@ -148,12 +148,10 @@ static int maceps2_probe(struct platform_device *dev) return 0; } -static int maceps2_remove(struct platform_device *dev) +static void maceps2_remove(struct platform_device *dev) { serio_unregister_port(maceps2_port[0]); serio_unregister_port(maceps2_port[1]); - - return 0; } static struct platform_driver maceps2_driver = { @@ -161,7 +159,7 @@ static struct platform_driver maceps2_driver = { .name = "maceps2", }, .probe = maceps2_probe, - .remove = maceps2_remove, + .remove_new = maceps2_remove, }; static int __init maceps2_init(void) From patchwork Wed Sep 20 12:58:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BCBACE79D1 for ; Wed, 20 Sep 2023 12:59:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236006AbjITM7O (ORCPT ); Wed, 20 Sep 2023 08:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236160AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41D1B134 for ; Wed, 20 Sep 2023 05:58:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwmz-0005XM-Cd; Wed, 20 Sep 2023 14:58:45 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmy-007h0k-Dt; Wed, 20 Sep 2023 14:58:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmy-003IEu-34; Wed, 20 Sep 2023 14:58:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: ye xingchen , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 38/52] input: olpc_apsp - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:15 +0200 Message-Id: <20230920125829.1478827-39-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1881; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fReQFlkCfPybI+fyuVzmCak9214FTU6WawvLTrOCDzw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxfCsHSSy/RXU2oYBRqiSrUfXjeXrftwSAoF NYi20ujKXWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsXwAKCRCPgPtYfRL+ TtheCACv6m8q9trDDNkxfOwK013rs5SHbTQGT8gUPUQrtJ7+tqa8ylw4NekHNr5FGdslsXNrgYE tl4R59T+PnfrcSbOGfM8bLDl4whSJqF5QsNUp8Oh57D6mevtxeOKq2dOG86JcA5GYL3pmsmCfN9 YQjrDVPh8Ncif+X8JKAP7MuIdK8Ea7ifozoGjfCmyPq3KwglrL0lwZNR45KE7yTdDbwUQZxiDpx b54L5ACTc9rRoArfFArlYqcTdOMG40t/d1/tZGC2euD5ZTLbXiBf1JrHni8yJUCGVTPbWylaLf5 ZUkMsy4gDu0AHwd9L35azlOySHboY+bEv/wFu+AXgoeKVw4u X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/olpc_apsp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c index 33a8e5889bd8..240a714f7081 100644 --- a/drivers/input/serio/olpc_apsp.c +++ b/drivers/input/serio/olpc_apsp.c @@ -238,7 +238,7 @@ static int olpc_apsp_probe(struct platform_device *pdev) return error; } -static int olpc_apsp_remove(struct platform_device *pdev) +static void olpc_apsp_remove(struct platform_device *pdev) { struct olpc_apsp *priv = platform_get_drvdata(pdev); @@ -246,8 +246,6 @@ static int olpc_apsp_remove(struct platform_device *pdev) serio_unregister_port(priv->kbio); serio_unregister_port(priv->padio); - - return 0; } static const struct of_device_id olpc_apsp_dt_ids[] = { @@ -258,7 +256,7 @@ MODULE_DEVICE_TABLE(of, olpc_apsp_dt_ids); static struct platform_driver olpc_apsp_driver = { .probe = olpc_apsp_probe, - .remove = olpc_apsp_remove, + .remove_new = olpc_apsp_remove, .driver = { .name = "olpc-apsp", .of_match_table = olpc_apsp_dt_ids, From patchwork Wed Sep 20 12:58:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAFCBCE79CE for ; Wed, 20 Sep 2023 12:59:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236228AbjITM7P (ORCPT ); Wed, 20 Sep 2023 08:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236227AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8144D1B8 for ; Wed, 20 Sep 2023 05:58:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn0-0005YI-6g; Wed, 20 Sep 2023 14:58:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmy-007h0o-MJ; Wed, 20 Sep 2023 14:58:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmy-003IEy-AP; Wed, 20 Sep 2023 14:58:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 39/52] input: ps2-gpio - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:16 +0200 Message-Id: <20230920125829.1478827-40-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1733; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nNh6iMKT6pcM5eScSqbtcJjQ2yirgWQ7MUdUQrNO8fs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxgKmz0HcLLYcf6ezcM4pLN1hg7L2OyGjnEf GBF9J20rYaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsYAAKCRCPgPtYfRL+ TmFiB/9faoX7R/oj/4sv44WCLv5b//ew31j/h/bEi3OOMx4xwSv4mEr8oV9rbHw5u2pVKwCJkZP 7CuvblNnFC8en7FLdmOQGoT99e7qEdYnIuzPruabb0zlVL1rgpq2WKscgl0cf9+r+5w0oB8yAhX 8NgDvzJunyjYPGrnUEQMv4JYObM8smZDid7mmXev8adNqwLNlbCBBvgdAxIJ6poRWiP07cMwKwF Cpp1Is4xwhQaNIrt5QOxRx3/mQktEHqwBalB5aJhVpYX96CbO2PNxLz+XLaH7uiRZY1OHld6I5I lTxXUH39xKfe4wfE4oTa3chG0Ufke8oTfzEJz9amxGMwM9d9 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/ps2-gpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c index bc1dc484389b..c3ff60859a03 100644 --- a/drivers/input/serio/ps2-gpio.c +++ b/drivers/input/serio/ps2-gpio.c @@ -476,12 +476,11 @@ static int ps2_gpio_probe(struct platform_device *pdev) return error; } -static int ps2_gpio_remove(struct platform_device *pdev) +static void ps2_gpio_remove(struct platform_device *pdev) { struct ps2_gpio_data *drvdata = platform_get_drvdata(pdev); serio_unregister_port(drvdata->serio); - return 0; } #if defined(CONFIG_OF) @@ -494,7 +493,7 @@ MODULE_DEVICE_TABLE(of, ps2_gpio_match); static struct platform_driver ps2_gpio_driver = { .probe = ps2_gpio_probe, - .remove = ps2_gpio_remove, + .remove_new = ps2_gpio_remove, .driver = { .name = DRIVER_NAME, .of_match_table = of_match_ptr(ps2_gpio_match), From patchwork Wed Sep 20 12:58:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392672 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF277CE79D0 for ; Wed, 20 Sep 2023 12:59:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235869AbjITM7O (ORCPT ); Wed, 20 Sep 2023 08:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236189AbjITM7F (ORCPT ); Wed, 20 Sep 2023 08:59:05 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3373125 for ; Wed, 20 Sep 2023 05:58:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn0-0005Zv-Cc; Wed, 20 Sep 2023 14:58:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmy-007h0r-Ti; Wed, 20 Sep 2023 14:58:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmy-003IF3-KR; Wed, 20 Sep 2023 14:58:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Christophe JAILLET , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 40/52] input: q40kbd - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:17 +0200 Message-Id: <20230920125829.1478827-41-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1740; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=3NA87Fw35hD22BEG9Qbq5UUK53fmztjINSWqrQSCBIc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxhcnMyX1vo0q08PxHM7+obQOzBX1l3seC1t DFCe6DEek6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsYQAKCRCPgPtYfRL+ TtjRB/9eIsdA402PsLzQhmDL/gNZKg2o41edOBSvJdw/VujVmQs7efNi7wA+QdcELkGNuh4oota UpoZ3pcrE3/gT/l5iengtohg2QZZCsNXmz3Suh6Q/BdvDnhmR4+bRAMP/mK+T13Byi1TGhHnVxh eninyZOc/ElsyQy6AeoQGG6bDrKTcrcSBTUc6vY09Qlm0zhT43aaqqRvtQN4l4cN4Of05h6VMWx dex+wOCQfoDuaYl8ZcNtr4sbzeDTUCDxYsnB5owR8tavsQF9JtUeIrzRs301zkktVtle9KqQGEO wGZVkNIXoWj8o4yhCOXVPTjh6QFnXk2hDiqbiWrakgX1JPG3 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/q40kbd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/q40kbd.c b/drivers/input/serio/q40kbd.c index ba04058fc3cb..3f81f8749cd5 100644 --- a/drivers/input/serio/q40kbd.c +++ b/drivers/input/serio/q40kbd.c @@ -148,7 +148,7 @@ static int q40kbd_probe(struct platform_device *pdev) return error; } -static int q40kbd_remove(struct platform_device *pdev) +static void q40kbd_remove(struct platform_device *pdev) { struct q40kbd *q40kbd = platform_get_drvdata(pdev); @@ -160,15 +160,13 @@ static int q40kbd_remove(struct platform_device *pdev) serio_unregister_port(q40kbd->port); free_irq(Q40_IRQ_KEYBOARD, q40kbd); kfree(q40kbd); - - return 0; } static struct platform_driver q40kbd_driver = { .driver = { .name = "q40kbd", }, - .remove = q40kbd_remove, + .remove_new = q40kbd_remove, }; module_platform_driver_probe(q40kbd_driver, q40kbd_probe); From patchwork Wed Sep 20 12:58:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C64AFCE79D2 for ; Wed, 20 Sep 2023 12:59:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236153AbjITM7S (ORCPT ); Wed, 20 Sep 2023 08:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236180AbjITM7H (ORCPT ); Wed, 20 Sep 2023 08:59:07 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA571185 for ; Wed, 20 Sep 2023 05:58:50 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn0-0005bP-UX; Wed, 20 Sep 2023 14:58:46 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmz-007h0v-6j; Wed, 20 Sep 2023 14:58:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmy-003IF7-RS; Wed, 20 Sep 2023 14:58:44 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Ruan Jinjie , Christophe JAILLET , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 41/52] input: rpckbd - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:18 +0200 Message-Id: <20230920125829.1478827-42-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1614; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=BcJ0AywxOV7G9krecrDeZFJTnE1lKJBvT4EpmtKIkgs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxiEPdB5NoqEu9duHO90iy0wFeDyR1VzYdHz KK4ZehG0EiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsYgAKCRCPgPtYfRL+ TuT5B/9BUS0Wno0+5YZoXN0Sb8RTIDfba64Excn8Kzkdhojjd89pmzYq/3dpAZrsCNBttjhAS0w rC4Dkdnx3bNnw49j0UTYqjOd2OTp5Qina7d7aWzzHoXY5ARNukHeDTnTUtHsZrhnkJUnI5RUUUQ vKV/m0wx5o6Ld7I9p+ujeE95CU5wQsjC3L4gAj7OJQVESrakDtJEjeddYv+cV7o+j2pm9gl8KwQ vKIQQw88Hqusv1NVg7f7NH/5fOQbjYOLdtUAKqs/gCnTWHlf29vfn95QrKAiGj4VzbLpa0ZedLF DWlPhpz81zeKp/W915vwdJZFdFd5Zp5ywHPL8oHdWRi/shHO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/rpckbd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c index e8a9709f32eb..9bbfefd092c0 100644 --- a/drivers/input/serio/rpckbd.c +++ b/drivers/input/serio/rpckbd.c @@ -133,20 +133,18 @@ static int rpckbd_probe(struct platform_device *dev) return 0; } -static int rpckbd_remove(struct platform_device *dev) +static void rpckbd_remove(struct platform_device *dev) { struct serio *serio = platform_get_drvdata(dev); struct rpckbd_data *rpckbd = serio->port_data; serio_unregister_port(serio); kfree(rpckbd); - - return 0; } static struct platform_driver rpckbd_driver = { .probe = rpckbd_probe, - .remove = rpckbd_remove, + .remove_new = rpckbd_remove, .driver = { .name = "kart", }, From patchwork Wed Sep 20 12:58:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392710 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2C8DCE79CE for ; Wed, 20 Sep 2023 12:59:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236342AbjITM7X (ORCPT ); Wed, 20 Sep 2023 08:59:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236310AbjITM7K (ORCPT ); Wed, 20 Sep 2023 08:59:10 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45AAA188 for ; Wed, 20 Sep 2023 05:58:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn1-0005cl-5S; Wed, 20 Sep 2023 14:58:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmz-007h0y-Cu; Wed, 20 Sep 2023 14:58:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmz-003IFB-3I; Wed, 20 Sep 2023 14:58:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 42/52] input: sun4i-ps2 - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:19 +0200 Message-Id: <20230920125829.1478827-43-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1857; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=9/tzG6hSPC1O7G4VLWSid0fAqDrsjXjJIrKCNtsf9XM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxjwrC0hABNvV8yIyxtcS5AEkzmBO4C+0b0H yKBlEGkQD6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsYwAKCRCPgPtYfRL+ TmzUB/sHyzeQmJlM6eoE28qcA8tKM2fHB6nWG7LueBBPhMWfRclE0VxCNVG7Rj15HnnF0jV8M8O RAWM/8orH1/vdA0dfXKLYTjrEndXdxzgj7zoxj0l/gQBBcPPwemuYsHXTs+hSXOoWwNq1N5WETu IajTpWmFGsUYnX76HxJaKmaVmSTcIez1HghHVmxJGc+3uvmZq55z2qBoU3EfcoR99cK5Ee/wazK L0PbyFEJu94SX21v3vbmC6XCNt/1dgdLTTf6Qt8aTJawt/7l1+XHjZAfsVg/7eaGMD8n2sH0m9i KoNmJqYJUyrNO5C/bpgnvi1bB7mSBhLvNPpyJGShJvNq9hHm X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec --- drivers/input/serio/sun4i-ps2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/sun4i-ps2.c b/drivers/input/serio/sun4i-ps2.c index eb262640192e..aec66d9f5176 100644 --- a/drivers/input/serio/sun4i-ps2.c +++ b/drivers/input/serio/sun4i-ps2.c @@ -297,7 +297,7 @@ static int sun4i_ps2_probe(struct platform_device *pdev) return error; } -static int sun4i_ps2_remove(struct platform_device *pdev) +static void sun4i_ps2_remove(struct platform_device *pdev) { struct sun4i_ps2data *drvdata = platform_get_drvdata(pdev); @@ -311,8 +311,6 @@ static int sun4i_ps2_remove(struct platform_device *pdev) iounmap(drvdata->reg_base); kfree(drvdata); - - return 0; } static const struct of_device_id sun4i_ps2_match[] = { @@ -324,7 +322,7 @@ MODULE_DEVICE_TABLE(of, sun4i_ps2_match); static struct platform_driver sun4i_ps2_driver = { .probe = sun4i_ps2_probe, - .remove = sun4i_ps2_remove, + .remove_new = sun4i_ps2_remove, .driver = { .name = DRIVER_NAME, .of_match_table = sun4i_ps2_match, From patchwork Wed Sep 20 12:58:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E036CE79D0 for ; Wed, 20 Sep 2023 12:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235952AbjITM7V (ORCPT ); Wed, 20 Sep 2023 08:59:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236278AbjITM7I (ORCPT ); Wed, 20 Sep 2023 08:59:08 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15D2699 for ; Wed, 20 Sep 2023 05:58:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn1-0005e3-Dz; Wed, 20 Sep 2023 14:58:47 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmz-007h14-JX; Wed, 20 Sep 2023 14:58:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmz-003IFE-9d; Wed, 20 Sep 2023 14:58:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Michal Simek , Rob Herring , linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 43/52] input: xilinx_ps2 - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:20 +0200 Message-Id: <20230920125829.1478827-44-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1959; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0CeKHSrpFi8VJT5ADH0g2h77fBe/JBdswra8dnYrk4U=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxkKl27fWqZ7qjvYFdjP5eyIHREWS3M4smp5 ZByxIeTfNuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsZAAKCRCPgPtYfRL+ Tk5uCACmp/3LN8RED0xxGPZTZ0qtkrb61WodRwkMNbTvCaenKZtTlt2JKQmP9Z4fM9oCS8rK7fl EF5NhlV9oivllu6ufOWEctPhM45juochU5xS6gchhlGlwLCWbWkpCG6Mab4ZyeWGJtVGcqviNOu 4tQM5IQ3YZGADO7eWVesyJziOHeDDWZmWJC4G3wfAygQq7qLtvzEHOoyITpqP6eWsFLKa93Twiw Qem0gPv0EyAH56yXsgh24h3Ul87e8nnDFvLKAosoVQg9nxg0E6vQ+jUXYTlyvttPVgX3xb0BO7d t+lb0vatC1hX+a9TN57mNaiFLwvs3xDBhenjGLPE5j0gNk+K X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/serio/xilinx_ps2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c index f3d28da70b75..d8f9faf2b529 100644 --- a/drivers/input/serio/xilinx_ps2.c +++ b/drivers/input/serio/xilinx_ps2.c @@ -329,7 +329,7 @@ static int xps2_of_probe(struct platform_device *ofdev) * if the driver module is being unloaded. It frees any resources allocated to * the device. */ -static int xps2_of_remove(struct platform_device *of_dev) +static void xps2_of_remove(struct platform_device *of_dev) { struct xps2data *drvdata = platform_get_drvdata(of_dev); struct resource r_mem; /* IO mem resources */ @@ -344,8 +344,6 @@ static int xps2_of_remove(struct platform_device *of_dev) release_mem_region(r_mem.start, resource_size(&r_mem)); kfree(drvdata); - - return 0; } /* Match table for of_platform binding */ @@ -361,7 +359,7 @@ static struct platform_driver xps2_of_driver = { .of_match_table = xps2_of_match, }, .probe = xps2_of_probe, - .remove = xps2_of_remove, + .remove_new = xps2_of_remove, }; module_platform_driver(xps2_of_driver); From patchwork Wed Sep 20 12:58:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392704 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B13ECE79CF for ; Wed, 20 Sep 2023 12:59:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235679AbjITM7U (ORCPT ); Wed, 20 Sep 2023 08:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236231AbjITM7I (ORCPT ); Wed, 20 Sep 2023 08:59:08 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1B001BF for ; Wed, 20 Sep 2023 05:58:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn1-0005fX-Vv; Wed, 20 Sep 2023 14:58:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwmz-007h18-St; Wed, 20 Sep 2023 14:58:45 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmz-003IFJ-JE; Wed, 20 Sep 2023 14:58:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Support Opensource , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 44/52] input: da9052_tsi - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:21 +0200 Message-Id: <20230920125829.1478827-45-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1736; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=N4QvTtRg+QIoVVoGZ9+IlG3wZB2FK+cFhbbKpC8LFHA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxmE8dCEFLyZcR4CQM4pCGSI59yO8sPOroDv R4VpApqWtiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsZgAKCRCPgPtYfRL+ Tsg3B/4w/1vMFhi/0uhFd6SkXFpwm3jq4WSb964/7ruLnQRw4mmkbuFoTIIRrvteJOMq+7dD/mi MPUjohMDB++zDaLrYGW1cQ54QO6iVY21ayC8mYvFWuATjvd9+eK8rnqNecaxuy4ws8gKSW2Rtrj naezhG3z1S//oK5BepR4OX3XVwhCOvk/VSm7BB11Op2Ifl1zmYirh9sZem5sA+TNEMiHvhq+LKr t8S4W8iM85dUW1pL5MyscG0uCQbT4Abymvs5STiGjl9rHtKFA8YG2FyI7t/0rm2FoNG+LJFpkpU VhEXLdYBZ2hYqwNe4QOawpys/AbdnyOQBDkPDtuEiQ8n1Fj7 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/touchscreen/da9052_tsi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/da9052_tsi.c b/drivers/input/touchscreen/da9052_tsi.c index f91d0e02ddae..d71690ce6463 100644 --- a/drivers/input/touchscreen/da9052_tsi.c +++ b/drivers/input/touchscreen/da9052_tsi.c @@ -311,7 +311,7 @@ static int da9052_ts_probe(struct platform_device *pdev) return error; } -static int da9052_ts_remove(struct platform_device *pdev) +static void da9052_ts_remove(struct platform_device *pdev) { struct da9052_tsi *tsi = platform_get_drvdata(pdev); @@ -322,13 +322,11 @@ static int da9052_ts_remove(struct platform_device *pdev) input_unregister_device(tsi->dev); kfree(tsi); - - return 0; } static struct platform_driver da9052_tsi_driver = { .probe = da9052_ts_probe, - .remove = da9052_ts_remove, + .remove_new = da9052_ts_remove, .driver = { .name = "da9052-tsi", }, From patchwork Wed Sep 20 12:58:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC5EBCE79CF for ; Wed, 20 Sep 2023 12:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234769AbjITM7W (ORCPT ); Wed, 20 Sep 2023 08:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236090AbjITM7J (ORCPT ); Wed, 20 Sep 2023 08:59:09 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C668192 for ; Wed, 20 Sep 2023 05:58:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn2-0005gW-4t; Wed, 20 Sep 2023 14:58:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwn0-007h1B-2m; Wed, 20 Sep 2023 14:58:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwmz-003IFN-Pm; Wed, 20 Sep 2023 14:58:45 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Robert Jarzmik , Dmitry Baryshkov , Arnd Bergmann , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 45/52] input: mainstone-wm97xx - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:22 +0200 Message-Id: <20230920125829.1478827-46-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1753; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lC3ygZTUVktuFO26GQrcLcsry+U4nk9RuYbUCLf6jig=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxnDgIBqqxqV70prFlWwfIN8nR0tYbK9+Q6y UQ8USmwLwKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsZwAKCRCPgPtYfRL+ ThvqCACtnpcu+EAvV6/xEQcqbmzc4vDHBHL8zxtJoQw/K8+YSi2YhgATTq4qitmnVbdT2Pp+pDB QMh2l9+NsEHhRcwxncU3QUwjYYqXxVtndV5q6oVWovQwmxpdqgWqy3QIKotQzCrXYFrA3Qv/obZ xjWDwlOcctcEXNAORSvpBbcbIRWoKJHrLOPdBKzvRllRQLAIKnjdQy35SnFE6QQzF1wtxef9iC2 u85W5M3PUv5XKz/IJRDEQA1nqA5IY9O2DYio/oZ+J0B9lzZWbljQ2yb91AaziwiIIp/yu1gPXd5 xQr77ezdoHCS0dWR9V0qguKhVTaPM00uJVghCJd7hAyws/vD X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/touchscreen/mainstone-wm97xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c index 85b95ed461e7..bfbebe245040 100644 --- a/drivers/input/touchscreen/mainstone-wm97xx.c +++ b/drivers/input/touchscreen/mainstone-wm97xx.c @@ -252,18 +252,16 @@ static int mainstone_wm97xx_probe(struct platform_device *pdev) return wm97xx_register_mach_ops(wm, &mainstone_mach_ops); } -static int mainstone_wm97xx_remove(struct platform_device *pdev) +static void mainstone_wm97xx_remove(struct platform_device *pdev) { struct wm97xx *wm = platform_get_drvdata(pdev); wm97xx_unregister_mach_ops(wm); - - return 0; } static struct platform_driver mainstone_wm97xx_driver = { .probe = mainstone_wm97xx_probe, - .remove = mainstone_wm97xx_remove, + .remove_new = mainstone_wm97xx_remove, .driver = { .name = "wm97xx-touch", }, From patchwork Wed Sep 20 12:58:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB2C4CE79D0 for ; Wed, 20 Sep 2023 12:59:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235970AbjITM7T (ORCPT ); Wed, 20 Sep 2023 08:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236047AbjITM7H (ORCPT ); Wed, 20 Sep 2023 08:59:07 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4E441BE for ; Wed, 20 Sep 2023 05:58:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn2-0005hv-9B; Wed, 20 Sep 2023 14:58:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwn0-007h1E-9c; Wed, 20 Sep 2023 14:58:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwn0-003IFR-0U; Wed, 20 Sep 2023 14:58:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 46/52] input: mc13783_ts - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:23 +0200 Message-Id: <20230920125829.1478827-47-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1647; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oVLUxNyjaub1YiVWOsaHCDPrLETVx9xQiELvVrYNZoU=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlSuNxnPL9d9kovQ2efqye/ztfnn++fCJzN0Joj2Onv+O 7HHK1Gmk9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJLBRm/+/qZZy9nMNGduNF L7W/HSe3FF1f1rQhTWrzpx6DGuapbpwTjizhXabYeckqcGnKjrMpla5ZM2rPJN6YErH5SML97mc pOgfDj4jLnSxfOeG2jkgVj+TK8iXFXEp/lRaUJZ9Jlqh/s8G+5NxWlmuBZ7nkzAL3mZ/vui7Q35 2+cmmjbdrCwOo7gaLhbE9y87sYb+Q3LpEIVOifu974Q1ZG4rfdLFIPRLMD05bwWM+Y9nPxbJcng lcPmQZb9vB1lqhGxx7wTU5+5PO3o2vfvVrm9GiNb7KMQtHdN1nMXROzpvIVL5GRj9zR5vno8WQz 1+SvYjGXmSve3/K1P9y7ZlHyC4m/eawmSl9+2goKRwoDAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/touchscreen/mc13783_ts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index ae0d978c83bf..cbcd6e34efb7 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c @@ -217,18 +217,16 @@ static int __init mc13783_ts_probe(struct platform_device *pdev) return ret; } -static int mc13783_ts_remove(struct platform_device *pdev) +static void mc13783_ts_remove(struct platform_device *pdev) { struct mc13783_ts_priv *priv = platform_get_drvdata(pdev); input_unregister_device(priv->idev); kfree(priv); - - return 0; } static struct platform_driver mc13783_ts_driver = { - .remove = mc13783_ts_remove, + .remove_new = mc13783_ts_remove, .driver = { .name = MC13783_TS_NAME, }, From patchwork Wed Sep 20 12:58:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392706 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4779FCE79CE for ; Wed, 20 Sep 2023 12:59:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236227AbjITM7V (ORCPT ); Wed, 20 Sep 2023 08:59:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236229AbjITM7H (ORCPT ); Wed, 20 Sep 2023 08:59:07 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 884B4E5 for ; Wed, 20 Sep 2023 05:58:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn2-0005jL-Cg; Wed, 20 Sep 2023 14:58:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwn0-007h1J-GH; Wed, 20 Sep 2023 14:58:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwn0-003IFV-7G; Wed, 20 Sep 2023 14:58:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 47/52] input: pcap_ts - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:24 +0200 Message-Id: <20230920125829.1478827-48-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1822; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=O9V+dbtrFe7O6zT8B/foRZxZSOZEnvwSslVl9rftPSA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxpIdP4HLl/LuuGRA3825iun0VFhIGQFDhNb gCKzGj+ceCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsaQAKCRCPgPtYfRL+ Ti+2B/4xfpJ5sPGX9iJ8HdTt3XhPSyrAJyBQ7T1JCa0UDZFWf+T7KE5RlN9vTCStRnjDUPRzcRt WfmZFfWkJUQ68GWH41oS3nUdDs53FoZ3haUy8jeh098sqHg8brPayqR5GgLORsfhT3DQwD4oAiq SjsLaPJ5ywdPJ7789RTdfg68cE1a9owgp4+ktSiCWiuXt3KqFanpYpl3nJO4thDq9T34ir2yJtv yuDFnBmMK+x5iSgi22tz9fWGVA9JNsbt7bD3EhohBC7aUGZ7hwR/M2eeXhr7eKwKdw9Gnn2GspT R165Br3dMAR9W9dExD/oUYVtX8Z3+47co+foLHq2IDkcBjNP X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/touchscreen/pcap_ts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/pcap_ts.c b/drivers/input/touchscreen/pcap_ts.c index b2da0194e02a..821245019fea 100644 --- a/drivers/input/touchscreen/pcap_ts.c +++ b/drivers/input/touchscreen/pcap_ts.c @@ -197,7 +197,7 @@ static int pcap_ts_probe(struct platform_device *pdev) return err; } -static int pcap_ts_remove(struct platform_device *pdev) +static void pcap_ts_remove(struct platform_device *pdev) { struct pcap_ts *pcap_ts = platform_get_drvdata(pdev); @@ -207,8 +207,6 @@ static int pcap_ts_remove(struct platform_device *pdev) input_unregister_device(pcap_ts->input); kfree(pcap_ts); - - return 0; } #ifdef CONFIG_PM @@ -240,7 +238,7 @@ static const struct dev_pm_ops pcap_ts_pm_ops = { static struct platform_driver pcap_ts_driver = { .probe = pcap_ts_probe, - .remove = pcap_ts_remove, + .remove_new = pcap_ts_remove, .driver = { .name = "pcap-ts", .pm = PCAP_TS_PM_OPS, From patchwork Wed Sep 20 12:58:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B67B4CE79D3 for ; Wed, 20 Sep 2023 12:59:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236301AbjITM7U (ORCPT ); Wed, 20 Sep 2023 08:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236275AbjITM7I (ORCPT ); Wed, 20 Sep 2023 08:59:08 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED41FE4 for ; Wed, 20 Sep 2023 05:58:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn2-0005kd-JX; Wed, 20 Sep 2023 14:58:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwn0-007h1M-Mt; Wed, 20 Sep 2023 14:58:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwn0-003IFZ-Dh; Wed, 20 Sep 2023 14:58:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Maxime Coquelin , Alexandre Torgue , linux-input@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 48/52] input: stmpe-ts - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:25 +0200 Message-Id: <20230920125829.1478827-49-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1745; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=joFLd3qLFbjJRTJtTX+NHFytmcS0AcvTPKAHVZOkxKI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxqeMQG7HcczT+up8xjmqHr+9d++ju6kGtV8 +2Y2QZ3NrCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsagAKCRCPgPtYfRL+ Tk+IB/9FHPxqZP+T04AUuOxaGQ85K5ius12Yvh5sizbi5JnUMlx1ViCRAKqhaDicM9zjdyJH6/m 3H11pjf2a4b9HUb/xITgS1hPoGggBWuWhYgxD6Cv8sU6kgnOJvrvyqu4+VOnELEVpKWOp1pMuWM q37vpy6i2DtcbpERSWaCGC8I5eE9fZ5y0ONvVNUD9LZst9eeob0pznauRUZtmeNPQFVQJ5VMb+Z ud1WuxX1yYaTt6UhSGzQkbr5ebji3QCwBiHMzN2AGQTB3oGFdEK0WfNz0dAIFe9ZgJ3pw1HTPwu /1CsOyIawPo2qKSoWLlVh9TTtegAY53fmFCaWhCSnvDtlyTD X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/touchscreen/stmpe-ts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c index 25c45c3a3561..b204fdb2d22c 100644 --- a/drivers/input/touchscreen/stmpe-ts.c +++ b/drivers/input/touchscreen/stmpe-ts.c @@ -350,13 +350,11 @@ static int stmpe_input_probe(struct platform_device *pdev) return 0; } -static int stmpe_ts_remove(struct platform_device *pdev) +static void stmpe_ts_remove(struct platform_device *pdev) { struct stmpe_touch *ts = platform_get_drvdata(pdev); stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); - - return 0; } static struct platform_driver stmpe_ts_driver = { @@ -364,7 +362,7 @@ static struct platform_driver stmpe_ts_driver = { .name = STMPE_TS_NAME, }, .probe = stmpe_input_probe, - .remove = stmpe_ts_remove, + .remove_new = stmpe_ts_remove, }; module_platform_driver(stmpe_ts_driver); From patchwork Wed Sep 20 12:58:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7811CE79CF for ; Wed, 20 Sep 2023 12:59:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236325AbjITM7Z (ORCPT ); Wed, 20 Sep 2023 08:59:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236232AbjITM7P (ORCPT ); Wed, 20 Sep 2023 08:59:15 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D226ED for ; Wed, 20 Sep 2023 05:58:59 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn3-0005lr-7Q; Wed, 20 Sep 2023 14:58:49 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwn0-007h1P-Ts; Wed, 20 Sep 2023 14:58:46 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwn0-003IFd-KN; Wed, 20 Sep 2023 14:58:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , "Rafael J. Wysocki" , Krzysztof Kozlowski , Daniel Lezcano , Jonathan Corbet , linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 49/52] input: sun4i-ts - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:26 +0200 Message-Id: <20230920125829.1478827-50-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1855; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zF4xZu+hwVC6L9733M9plkhU8fvddRnK55gpTuc7Vgc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxrqjnosHJ8C+UWdQ9SSqEsDaJf8YeepCMl6 Dz31Yhm+9mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsawAKCRCPgPtYfRL+ TufgB/wIzdbOjhnYmod3UlF216YglsMYuG6yfO4qP6mOpAwxOZyb95LGe9Ues464HKE8BCR37M+ ag2d8E3T6NsfX8eTOwD8rqfEVGy1B+FaEAS0h8iI1dwzPqEGxQ7HnKCjHXCSeFSTi4gVBLLr+A1 ajAI65d5ZBm6RBKUxBmAj8rQQEXr4fcoMlNkOVzmkzGmmBfTjR95xplqAuF04h3CFU15MPmnLAQ EUaaGGLBTMpn7KrYt1MALqDqMp1UBGYgcaq0MeW+Lwuzzk4a/q5Mu2ShP906iZzX358k2ti4oMU 7CiBuWSz/bcWdFCsGrjQTKddfH6WmY28l0aPcK6PWyq1DaX9 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec --- drivers/input/touchscreen/sun4i-ts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c index bb3c6072fc82..92b2b840b4b7 100644 --- a/drivers/input/touchscreen/sun4i-ts.c +++ b/drivers/input/touchscreen/sun4i-ts.c @@ -375,7 +375,7 @@ static int sun4i_ts_probe(struct platform_device *pdev) return 0; } -static int sun4i_ts_remove(struct platform_device *pdev) +static void sun4i_ts_remove(struct platform_device *pdev) { struct sun4i_ts_data *ts = platform_get_drvdata(pdev); @@ -385,8 +385,6 @@ static int sun4i_ts_remove(struct platform_device *pdev) /* Deactivate all IRQs */ writel(0, ts->base + TP_INT_FIFOC); - - return 0; } static const struct of_device_id sun4i_ts_of_match[] = { @@ -403,7 +401,7 @@ static struct platform_driver sun4i_ts_driver = { .of_match_table = sun4i_ts_of_match, }, .probe = sun4i_ts_probe, - .remove = sun4i_ts_remove, + .remove_new = sun4i_ts_remove, }; module_platform_driver(sun4i_ts_driver); From patchwork Wed Sep 20 12:58:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392712 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01988CE79D4 for ; Wed, 20 Sep 2023 12:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236279AbjITM7Z (ORCPT ); Wed, 20 Sep 2023 08:59:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236339AbjITM7L (ORCPT ); Wed, 20 Sep 2023 08:59:11 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D48018D for ; Wed, 20 Sep 2023 05:58:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn2-0005ms-RN; Wed, 20 Sep 2023 14:58:48 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwn1-007h1T-4P; Wed, 20 Sep 2023 14:58:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwn0-003IFh-RA; Wed, 20 Sep 2023 14:58:46 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Linus Walleij , Rob Herring , Jonathan Cameron , linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 50/52] input: ti_am335x_tsc - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:27 +0200 Message-Id: <20230920125829.1478827-51-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1875; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ReFzrVG8Z1aAqjwjfetBIdUuXAR+7lpNJKPtdBjMCeQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxtfmNugePylyquZe0tdj1QRod/3Vb16zHu3 YtMDdM+1dSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsbQAKCRCPgPtYfRL+ ThgGCACh1yvWbxj1yPf89URnCggehx31wW01PRq3epSZqmYFYuk1XzVLKo+1wXetXL67jlxhKg/ dFneHwYdI6/ogjmixTcLeN2hIAt7qK7seF6HmbOfPu1NIt8ZQXnjN/sygaIp7OwIB3EHWlUD8Gh lUVrI1RKM7pbPrOVEr5rcwfsL7eha4ba9g8VAB8TN0xVp5NmeT/8bOAHUFvv8CIBzKyEC5EFSgd Nre8REu5MxdpDUZlryB/g5C8LCgsz3Y7IXaZNI0QRHbiCgyOHhSSvsS/M17DsbuBeFNKu+CVskz vv7in5mEBsWqnITEJ2AJR4oCVrNhhGMKB3i4JIwfk4mIn3G5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/input/touchscreen/ti_am335x_tsc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index 9aa4e35fb4f5..34324f8512ac 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -491,7 +491,7 @@ static int titsc_probe(struct platform_device *pdev) return err; } -static int titsc_remove(struct platform_device *pdev) +static void titsc_remove(struct platform_device *pdev) { struct titsc *ts_dev = platform_get_drvdata(pdev); u32 steps; @@ -508,7 +508,6 @@ static int titsc_remove(struct platform_device *pdev) input_unregister_device(ts_dev->input); kfree(ts_dev); - return 0; } static int titsc_suspend(struct device *dev) @@ -552,7 +551,7 @@ MODULE_DEVICE_TABLE(of, ti_tsc_dt_ids); static struct platform_driver ti_tsc_driver = { .probe = titsc_probe, - .remove = titsc_remove, + .remove_new = titsc_remove, .driver = { .name = "TI-am335x-tsc", .pm = pm_sleep_ptr(&titsc_pm_ops), From patchwork Wed Sep 20 12:58:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392708 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30E94CE79D2 for ; Wed, 20 Sep 2023 12:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236231AbjITM7W (ORCPT ); Wed, 20 Sep 2023 08:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234463AbjITM7J (ORCPT ); Wed, 20 Sep 2023 08:59:09 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 632BAF7 for ; Wed, 20 Sep 2023 05:58:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn3-0005nt-9C; Wed, 20 Sep 2023 14:58:49 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwn1-007h1X-BQ; Wed, 20 Sep 2023 14:58:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwn1-003IFl-2C; Wed, 20 Sep 2023 14:58:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: patches@opensource.cirrus.com, linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 51/52] input: wm831x-ts - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:28 +0200 Message-Id: <20230920125829.1478827-52-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1797; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kQlCA2NL+Ej0oQRdTH+atbteL8w2LJMkYJLOiJLucpI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxuBo7oAUy2Wl7oYbsrsYUF/QBhb/7qjpGis w69RCCohjWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsbgAKCRCPgPtYfRL+ Tq6yB/0cZoGjUpGgORAmSU+paZYWiflNhECFrbSkBSDG89DiILTi+cCxALNKpsQHxzLQtADkPSk n30l+Q4ot/LLKjNmN35JVWiLFoCLql+DNzRyd2ntycU77sIpaHYodsoSZfiSusCckyZQHgjm2aQ J1tl8mLvaP3qL/F1k46PZKUBO5pxYebNPiW67mJ/oF0uYkILY3G8kK++iZ5deMxfRTlRP/3joj3 /9J3RpBOSNgcwzkKo0qJDUEKWbCJdLxBb15N/VDAB/eU1axW+SXVV0evUzxP8UJ+p/O89IQ5zBa yko6G/p1X7ZcJR4aAhPWIA3TezCI1fR0EURayzZva4jLxTtv X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Charles Keepax --- drivers/input/touchscreen/wm831x-ts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c index 319f57fb9af5..9cee26b63341 100644 --- a/drivers/input/touchscreen/wm831x-ts.c +++ b/drivers/input/touchscreen/wm831x-ts.c @@ -374,14 +374,12 @@ static int wm831x_ts_probe(struct platform_device *pdev) return error; } -static int wm831x_ts_remove(struct platform_device *pdev) +static void wm831x_ts_remove(struct platform_device *pdev) { struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev); free_irq(wm831x_ts->pd_irq, wm831x_ts); free_irq(wm831x_ts->data_irq, wm831x_ts); - - return 0; } static struct platform_driver wm831x_ts_driver = { @@ -389,7 +387,7 @@ static struct platform_driver wm831x_ts_driver = { .name = "wm831x-touch", }, .probe = wm831x_ts_probe, - .remove = wm831x_ts_remove, + .remove_new = wm831x_ts_remove, }; module_platform_driver(wm831x_ts_driver); From patchwork Wed Sep 20 12:58:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13392711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C44ACE79D0 for ; Wed, 20 Sep 2023 12:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235712AbjITM7X (ORCPT ); Wed, 20 Sep 2023 08:59:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236279AbjITM7L (ORCPT ); Wed, 20 Sep 2023 08:59:11 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9AFFC2 for ; Wed, 20 Sep 2023 05:58:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiwn3-0005oZ-GS; Wed, 20 Sep 2023 14:58:49 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qiwn1-007h1b-He; Wed, 20 Sep 2023 14:58:47 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qiwn1-003IFp-8E; Wed, 20 Sep 2023 14:58:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Linus Walleij , Jonathan Cameron , patches@opensource.cirrus.com, linux-input@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 52/52] input: wm97xx-core - Convert to platform remove callback returning void Date: Wed, 20 Sep 2023 14:58:29 +0200 Message-Id: <20230920125829.1478827-53-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> References: <20230920125829.1478827-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1691; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=71HgYUKiNIm19iVrPl0W4L7SGw74AtUzgLH8Po3g26s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlCuxvDK8FKadSf/H8l+ExpGhItbrqDOcWzrWhD aQua9r4TVKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZQrsbwAKCRCPgPtYfRL+ ToVJB/4hwHs7QOP5HKNJcXRh8aLqiSiYCJB1xuh9AKN+tTdKog48MDIu67TC5KAjXSPi91Zbqi5 aTuaRgeJ1jAYzcMFtECe9iVoihTq5ColhL9FEVWDQ1d+XCzxuLFocNDgUvZ+HDl/l0ojsRAleNm FgtUL7+TWs7KEhY18mJyq+ilb5xSio3dgPp2GFK6Rc4nA6BlA9aN3SeIt96D2JBPRbm4HiOWXYp wEde2fVGwJ4P+kvz5T5cXFaTLckutXpRpSAnbR64ytkk7ILwBuI0FKKWTh8x1W/nQZDOZoh+eTz P3PZJyZFA/Quns/BvqToFsxhOWAFdXwD1rMq4faIPl6uBlnl X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-input@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Charles Keepax --- drivers/input/touchscreen/wm97xx-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index ac3b3dd59488..f01f6cc9b59f 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c @@ -756,11 +756,9 @@ static int wm97xx_mfd_probe(struct platform_device *pdev) return ret; } -static int wm97xx_mfd_remove(struct platform_device *pdev) +static void wm97xx_mfd_remove(struct platform_device *pdev) { wm97xx_remove(&pdev->dev); - - return 0; } static int wm97xx_suspend(struct device *dev) @@ -878,7 +876,7 @@ static struct platform_driver wm97xx_mfd_driver = { .pm = pm_sleep_ptr(&wm97xx_pm_ops), }, .probe = wm97xx_mfd_probe, - .remove = wm97xx_mfd_remove, + .remove_new = wm97xx_mfd_remove, }; static int __init wm97xx_init(void)