From patchwork Wed Sep 27 08:10: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: 13400340 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 5E335E810A2 for ; Wed, 27 Sep 2023 08:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230223AbjI0ILW (ORCPT ); Wed, 27 Sep 2023 04:11:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbjI0ILC (ORCPT ); Wed, 27 Sep 2023 04:11: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 CFA60CDB for ; Wed, 27 Sep 2023 01:10:57 -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 1qlPdB-000842-KG; Wed, 27 Sep 2023 10:10: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 1qlPdA-009I7d-Px; Wed, 27 Sep 2023 10:10:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdA-005BQw-GX; Wed, 27 Sep 2023 10:10:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Vadim Pasternak Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/27] platform/mellanox: mlxbf-bootctl: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:27 +0200 Message-Id: <20230927081040.2198742-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1712; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+Ir65hE13KMzfZwrYtgBOwv1Y990W+ZpXu4su6/aAis=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+NtbwIJLSwu+ovYaCgB85EMrNNoExGsUEWKY 6yvz4UDZqOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjbQAKCRCPgPtYfRL+ TgO1B/9lVJPfewfvrMAYbtIWl/9JsCA65yFxAjoW5m7TDXDyWVMWjotZ8pMTKxX+tb2u3mOwxki VjwCNniI3AjB5msfEMqnwoxbSEDo00zeVmwkYxTQDMJqmMMlnpfVoMAb62GZj21ly7WnDWbCABx xFtOEEjXLJcdAGuNKdibWtTKeU5U9W61cSshP/jfQ0/VGnOti3AsMTRGE/n/LM2rSkNVWpBnUVs SB3EvZIPIub/KgAoiOrCHzi8IwYSwkRWM6I19WU68zAb6OGJLMGw8QR2eCG8F1BJnhnql/isi2x JhD2phvWkXnbT2k3+HwLrDn/FrRsS826fmGoEw7CX6ZNPAqx 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/mellanox/mlxbf-bootctl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c index 4ee7bb431b7c..1ac7dab22c63 100644 --- a/drivers/platform/mellanox/mlxbf-bootctl.c +++ b/drivers/platform/mellanox/mlxbf-bootctl.c @@ -1028,17 +1028,15 @@ static int mlxbf_bootctl_probe(struct platform_device *pdev) return ret; } -static int mlxbf_bootctl_remove(struct platform_device *pdev) +static void mlxbf_bootctl_remove(struct platform_device *pdev) { sysfs_remove_bin_file(&pdev->dev.kobj, &mlxbf_bootctl_bootfifo_sysfs_attr); - - return 0; } static struct platform_driver mlxbf_bootctl_driver = { .probe = mlxbf_bootctl_probe, - .remove = mlxbf_bootctl_remove, + .remove_new = mlxbf_bootctl_remove, .driver = { .name = "mlxbf-bootctl", .dev_groups = mlxbf_bootctl_groups, From patchwork Wed Sep 27 08:10: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: 13400339 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 6E423E810A4 for ; Wed, 27 Sep 2023 08:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbjI0ILY (ORCPT ); Wed, 27 Sep 2023 04:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbjI0ILC (ORCPT ); Wed, 27 Sep 2023 04:11: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 110BCB3 for ; Wed, 27 Sep 2023 01:10:57 -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 1qlPdB-00084H-Vo; Wed, 27 Sep 2023 10:10: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 1qlPdA-009I7h-W5; Wed, 27 Sep 2023 10:10:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdA-005BR0-Mr; Wed, 27 Sep 2023 10:10:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Vadim Pasternak Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/27] platform/mellanox: mlxbf-tmfifo: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:28 +0200 Message-Id: <20230927081040.2198742-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-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=CxjrzFzEkM6O7z80cNwT5EXT0bqldk5XDjLUTnuR0Y0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+NuMm1KeBgObA5wqP/oMc1QGazphFC29+aTn seP42tD4gqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjbgAKCRCPgPtYfRL+ TjIwB/4xndkYpQ+BvWFG8bVLBguRWGmAkFUJDqI5N74Z2ObmukEKyraFnnmO1r1lJ2ii9Nk2lnn X8s7u/n9zMb41hlp5UfsvtmoW1yN2xj69NFrf0GL+7xtzlEHzdTgkSPQbT1nxfLIOzgfJlQiVzJ iONvs33bN909TfnUw0Ecg1J1X9kLNSCvMM5g97kzdJVqMPzTcvSRy8beyb/rA3yXWrUYVqmz7Yr qYvPnxl5RmgTAHmednfhLnZTYXJNO5jlMQU9IAaNiRwr7LrnXo/wy88P2/Y5IkYrIk31EktNflg tt95oGMo2opbb9SjOW7YpYGafkmHQXbcbFboYwjA23AcBh74 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/mellanox/mlxbf-tmfifo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c index f3696a54a2bd..69729ba8f505 100644 --- a/drivers/platform/mellanox/mlxbf-tmfifo.c +++ b/drivers/platform/mellanox/mlxbf-tmfifo.c @@ -1361,13 +1361,11 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev) } /* Device remove function. */ -static int mlxbf_tmfifo_remove(struct platform_device *pdev) +static void mlxbf_tmfifo_remove(struct platform_device *pdev) { struct mlxbf_tmfifo *fifo = platform_get_drvdata(pdev); mlxbf_tmfifo_cleanup(fifo); - - return 0; } static const struct acpi_device_id mlxbf_tmfifo_acpi_match[] = { @@ -1378,7 +1376,7 @@ MODULE_DEVICE_TABLE(acpi, mlxbf_tmfifo_acpi_match); static struct platform_driver mlxbf_tmfifo_driver = { .probe = mlxbf_tmfifo_probe, - .remove = mlxbf_tmfifo_remove, + .remove_new = mlxbf_tmfifo_remove, .driver = { .name = "bf-tmfifo", .acpi_match_table = mlxbf_tmfifo_acpi_match, From patchwork Wed Sep 27 08:10: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: 13400336 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 A0361E810A3 for ; Wed, 27 Sep 2023 08:11:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230268AbjI0ILJ (ORCPT ); Wed, 27 Sep 2023 04:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbjI0ILB (ORCPT ); Wed, 27 Sep 2023 04:11:01 -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 8238FCDA for ; Wed, 27 Sep 2023 01:10:57 -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 1qlPdC-00084s-5c; Wed, 27 Sep 2023 10:10:50 +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 1qlPdB-009I7k-6e; Wed, 27 Sep 2023 10:10:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdA-005BR4-Tm; Wed, 27 Sep 2023 10:10:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Vadim Pasternak Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 16/27] platform/mellanox: mlxreg-hotplug: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:29 +0200 Message-Id: <20230927081040.2198742-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1906; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=E1EtfCdvL5BCirg1ur2IQNU7vZ4qAkjOL+kP2gKTw5k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+NwG78MBx7tIkqC0uEqWcAFKkqlNa6mtOqO4 7ZcwyBcivqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjcAAKCRCPgPtYfRL+ TueMB/9v6Xjw8xEB+p3Dh7cgTDM6mL9o/iJBzTm8P8CT94rpzvYE60KNf23G/De+bVPcqLc9e1L bnNli0nmcvP9RtX6OF12QVH/lTzK3x+ewvATcCyrBICqj2df1ltRMgQsRcIX6F3KzGBkFx/XddR UxMQ002pmDF1TUPn8YT/8ZFctwqzryeOzHMaM43Z0ai1BLU4c8G9PGer71+B8s6XX1FjJ8BykOa SxVron71EW1qP+ak5bSYRcCFfh/39pMKMYAqXDhDSoeSJo/VhI9P+zJZGFrNCmz/gz7pvYeF1e7 Z3tE2I16yy/r1BnVuTAXeoW+ahEo/rZaQ1s42A0UuavgpDPL 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/mellanox/mlxreg-hotplug.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index eb5ad35274dd..5c022b258f91 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -786,15 +786,13 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev) return 0; } -static int mlxreg_hotplug_remove(struct platform_device *pdev) +static void mlxreg_hotplug_remove(struct platform_device *pdev) { struct mlxreg_hotplug_priv_data *priv = dev_get_drvdata(&pdev->dev); /* Clean interrupts setup. */ mlxreg_hotplug_unset_irq(priv); devm_free_irq(&pdev->dev, priv->irq, priv); - - return 0; } static struct platform_driver mlxreg_hotplug_driver = { @@ -802,7 +800,7 @@ static struct platform_driver mlxreg_hotplug_driver = { .name = "mlxreg-hotplug", }, .probe = mlxreg_hotplug_probe, - .remove = mlxreg_hotplug_remove, + .remove_new = mlxreg_hotplug_remove, }; module_platform_driver(mlxreg_hotplug_driver); From patchwork Wed Sep 27 08:10:30 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: 13400338 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 00E31E810A5 for ; Wed, 27 Sep 2023 08:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230222AbjI0ILU (ORCPT ); Wed, 27 Sep 2023 04:11:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230155AbjI0ILC (ORCPT ); Wed, 27 Sep 2023 04:11: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 398F9191 for ; Wed, 27 Sep 2023 01:10:58 -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 1qlPdC-00085h-5f; Wed, 27 Sep 2023 10:10:50 +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 1qlPdB-009I7p-DJ; Wed, 27 Sep 2023 10:10:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdB-005BR8-40; Wed, 27 Sep 2023 10:10:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Vadim Pasternak Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/27] platform/mellanox: mlxreg-io: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:30 +0200 Message-Id: <20230927081040.2198742-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1748; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=W1A4okYNik1VMgJpJLoBZFEE+DlDZ2qN4h6QATaBCC4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+Nxthg5Ec1AQ5v355kFCMJJ81EwvWpNdy6Ea fI7RfQySLyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjcQAKCRCPgPtYfRL+ Tg/qB/wJX8G3HE0qqXOb9ERJi68xtzC2i1a+W9RDR+4APiDhliH6rE7GesPvO/MumZIkUOuoviU gPDp9kYrqTBTiseLDrlp4InyXLXouMtVlmgN4Cvuuj6FpVhiW22T0pYdODxXmcrNPSnvYrqGrLF mB6tqWZnfiB/pvKbja0YrVQhrfminKhUgBlKSF2jGjky2VLwgyqgw6E34Kwfuf7iIk8ghivGUh1 K3cxZmsZ5l1P2pNUtwFTJE92rejSB5ojYAyKsMwBOaJP/qm0oQvYIUz7/FajJTyfwbywO1jJ9nk oJqOUqu4ZT0UCZjzmjozuS9cW2VJyoBp7WiygWy4sIp/TquW 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/mellanox/mlxreg-io.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-io.c b/drivers/platform/mellanox/mlxreg-io.c index 83ba037408cd..ee7bd623ba44 100644 --- a/drivers/platform/mellanox/mlxreg-io.c +++ b/drivers/platform/mellanox/mlxreg-io.c @@ -263,13 +263,11 @@ static int mlxreg_io_probe(struct platform_device *pdev) return 0; } -static int mlxreg_io_remove(struct platform_device *pdev) +static void mlxreg_io_remove(struct platform_device *pdev) { struct mlxreg_io_priv_data *priv = dev_get_drvdata(&pdev->dev); mutex_destroy(&priv->io_lock); - - return 0; } static struct platform_driver mlxreg_io_driver = { @@ -277,7 +275,7 @@ static struct platform_driver mlxreg_io_driver = { .name = "mlxreg-io", }, .probe = mlxreg_io_probe, - .remove = mlxreg_io_remove, + .remove_new = mlxreg_io_remove, }; module_platform_driver(mlxreg_io_driver); From patchwork Wed Sep 27 08:10:31 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: 13400343 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 7782FE810A2 for ; Wed, 27 Sep 2023 08:11:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230149AbjI0ILg (ORCPT ); Wed, 27 Sep 2023 04:11:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbjI0ILE (ORCPT ); Wed, 27 Sep 2023 04:11: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 E37EA12A for ; Wed, 27 Sep 2023 01:10: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 1qlPdC-00086H-Ct; Wed, 27 Sep 2023 10:10:50 +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 1qlPdB-009I7u-Jh; Wed, 27 Sep 2023 10:10:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdB-005BRC-AM; Wed, 27 Sep 2023 10:10:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Vadim Pasternak Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 18/27] platform/mellanox: mlxreg-lc: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:31 +0200 Message-Id: <20230927081040.2198742-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2109; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OgebHyJ1o+cakI4Sj28nDr13s9jhvV2dMgyHvpitWxQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+NyGqwa6XJjBwLMBt7Pdf+hattOnrde7yDsd 71DtewBv0+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjcgAKCRCPgPtYfRL+ Tp3SB/4jwksQ8EhV3Nuh3lkJZhSyHogXAPjwyPD1wGV7NPFab/t2cFXfYdlwFQt9SOHaQDXlbp0 0Y2o8ZOFaCG+oI87zAc9896w+T/BtGClnvhp43y8Cr5UY7+KNTyPZTypTbAitzAiZYs1r0FaArt f9VyJMWxxgEdlsNn1xPLwL6kVKBe1WEpWkVq2t+Ic/ciDZoDki34aSKZOMqHHykz6tcPQWubMtJ donb5xxPfH2aUfQ/ADU2x2iaxjWpnpAmnftznwesz3rDr1Jy01VYd4szC3TgcJQ66nsE0ELAfgF tnCsrHtc4PgmbF7tgenjfqda1H4xSoMhyhiksDXXXbvgHhbd 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/mellanox/mlxreg-lc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-lc.c b/drivers/platform/mellanox/mlxreg-lc.c index 8d833836a6d3..43d119e3a473 100644 --- a/drivers/platform/mellanox/mlxreg-lc.c +++ b/drivers/platform/mellanox/mlxreg-lc.c @@ -907,7 +907,7 @@ static int mlxreg_lc_probe(struct platform_device *pdev) return err; } -static int mlxreg_lc_remove(struct platform_device *pdev) +static void mlxreg_lc_remove(struct platform_device *pdev) { struct mlxreg_core_data *data = dev_get_platdata(&pdev->dev); struct mlxreg_lc *mlxreg_lc = platform_get_drvdata(pdev); @@ -921,7 +921,7 @@ static int mlxreg_lc_remove(struct platform_device *pdev) * is nothing to remove. */ if (!data->notifier || !data->notifier->handle) - return 0; + return; /* Clear event notification callback and handle. */ data->notifier->user_handler = NULL; @@ -940,13 +940,11 @@ static int mlxreg_lc_remove(struct platform_device *pdev) i2c_put_adapter(data->hpdev.adapter); data->hpdev.adapter = NULL; } - - return 0; } static struct platform_driver mlxreg_lc_driver = { .probe = mlxreg_lc_probe, - .remove = mlxreg_lc_remove, + .remove_new = mlxreg_lc_remove, .driver = { .name = "mlxreg-lc", }, From patchwork Wed Sep 27 08:10:32 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: 13400341 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 2A05CE810A5 for ; Wed, 27 Sep 2023 08:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230162AbjI0ILf (ORCPT ); Wed, 27 Sep 2023 04:11:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230149AbjI0ILD (ORCPT ); Wed, 27 Sep 2023 04:11:03 -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 7F45119C for ; Wed, 27 Sep 2023 01:10: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 1qlPdC-00086t-Jn; Wed, 27 Sep 2023 10:10:50 +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 1qlPdB-009I7y-QL; Wed, 27 Sep 2023 10:10:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdB-005BRG-H4; Wed, 27 Sep 2023 10:10:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Vadim Pasternak Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 19/27] platform/mellanox: nvsw-sn2201: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:32 +0200 Message-Id: <20230927081040.2198742-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2047; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6XfHk0S7bPOzQoL6+8JJudU1CUxgDhv75KyTmedpZUw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+NzWIGN/61OxNnBHOlQieO5BOjJVQ2TaOhNX iAEfMwuXiOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjcwAKCRCPgPtYfRL+ TmI+B/4weiDZumoyGKba8bd4q0TK/I1+YV8rcG4ye97HqiBQ5ZF0vpggBZSSoHvyT3HyCccblJS wUZ/r1gPvOlJ2itBa+UySAtoAwwXKUEmP014qU4GGFN3pLL6u8kIKX11gkINJylWdAK0yZ747JT 55unsHgiUKSiqgeke7PiOy7lwuzwjrQktjbr7bf4WfjGm9cSXYmOxM7d6+USokuKWXAMrv+9Fbi JJhEN/aMGpxCxH5+R4m3E5g4JtGi/rqq7RhAkdEvHkWllgNNeqMu6NoIoSJTIyMfTrIU732GK+Q THruy2dF3ffrYZY4qibyYdJoT/EKNOLwdz69i5oH7HR9CX0H 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/mellanox/nvsw-sn2201.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c index 75b699676ca6..3ef655591424 100644 --- a/drivers/platform/mellanox/nvsw-sn2201.c +++ b/drivers/platform/mellanox/nvsw-sn2201.c @@ -1217,7 +1217,7 @@ static int nvsw_sn2201_probe(struct platform_device *pdev) return nvsw_sn2201_config_pre_init(nvsw_sn2201); } -static int nvsw_sn2201_remove(struct platform_device *pdev) +static void nvsw_sn2201_remove(struct platform_device *pdev) { struct nvsw_sn2201 *nvsw_sn2201 = platform_get_drvdata(pdev); @@ -1239,8 +1239,6 @@ static int nvsw_sn2201_remove(struct platform_device *pdev) /* Unregister I2C controller. */ if (nvsw_sn2201->pdev_i2c) platform_device_unregister(nvsw_sn2201->pdev_i2c); - - return 0; } static const struct acpi_device_id nvsw_sn2201_acpi_ids[] = { @@ -1252,7 +1250,7 @@ MODULE_DEVICE_TABLE(acpi, nvsw_sn2201_acpi_ids); static struct platform_driver nvsw_sn2201_driver = { .probe = nvsw_sn2201_probe, - .remove = nvsw_sn2201_remove, + .remove_new = nvsw_sn2201_remove, .driver = { .name = "nvsw-sn2201", .acpi_match_table = nvsw_sn2201_acpi_ids, From patchwork Wed Sep 27 08:10:33 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: 13400335 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 DB28EE810A4 for ; Wed, 27 Sep 2023 08:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230062AbjI0ILJ (ORCPT ); Wed, 27 Sep 2023 04:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbjI0ILB (ORCPT ); Wed, 27 Sep 2023 04:11:01 -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 6F759CD7 for ; Wed, 27 Sep 2023 01:10:57 -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 1qlPdC-00087e-Ts; Wed, 27 Sep 2023 10:10:50 +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 1qlPdC-009I82-41; Wed, 27 Sep 2023 10:10:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdB-005BRK-Qc; Wed, 27 Sep 2023 10:10:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/27] platform/x86/intel: bytcrc_pwrsrc: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:33 +0200 Message-Id: <20230927081040.2198742-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1684; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IkF+lDlwkjN6K0Pm182MURz1DLLLDEBB1BOOwDNN+eI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+N0lNm/++rcZ9gWDa7GNwRypiCKj8esDvynT KCcU7W4EoeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjdAAKCRCPgPtYfRL+ TkW7B/9s2E//wds1uDhEk2MGJH2TzzUldIFG09J+/gHRo8cFr/zCPNzESt1KHw7RVz3uPyx142/ pKH8U1eWocchJGhZQYnZjJhxWK2p7H+7CGQ4oOmI09Uae6mAPkyvcepx3VGhlMH9Jq3Rmu8u7vX +l5L0LWDRv7oNHfEdIEkoWCjXqIZNpK6LrbHsfZFG9sTDSbKa8y1X5Qt5hQJfHODnHC/+3Y0776 py7RCpYIfPBjqux0SIVG4vEot8rL8UG5JYMvKAN+zAateFbIikZZLnO/fh6qY8fdLz479G4RbUI CDBR0cK+aViC04gtWxMtxLJjc9Mjm03PrK+YziQtXaC6ccC4 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/x86/intel/bytcrc_pwrsrc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/bytcrc_pwrsrc.c b/drivers/platform/x86/intel/bytcrc_pwrsrc.c index 8a022b90d12d..418b71af27ff 100644 --- a/drivers/platform/x86/intel/bytcrc_pwrsrc.c +++ b/drivers/platform/x86/intel/bytcrc_pwrsrc.c @@ -158,17 +158,16 @@ static int crc_pwrsrc_probe(struct platform_device *pdev) return 0; } -static int crc_pwrsrc_remove(struct platform_device *pdev) +static void crc_pwrsrc_remove(struct platform_device *pdev) { struct crc_pwrsrc_data *data = platform_get_drvdata(pdev); debugfs_remove_recursive(data->debug_dentry); - return 0; } static struct platform_driver crc_pwrsrc_driver = { .probe = crc_pwrsrc_probe, - .remove = crc_pwrsrc_remove, + .remove_new = crc_pwrsrc_remove, .driver = { .name = "crystal_cove_pwrsrc", }, From patchwork Wed Sep 27 08:10:34 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: 13400331 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 9516BE810A4 for ; Wed, 27 Sep 2023 08:11:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbjI0ILE (ORCPT ); Wed, 27 Sep 2023 04:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbjI0ILA (ORCPT ); Wed, 27 Sep 2023 04:11:00 -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 EFEAB1BF for ; Wed, 27 Sep 2023 01:10: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 1qlPdD-00088U-6A; Wed, 27 Sep 2023 10:10:51 +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 1qlPdC-009I86-Bi; Wed, 27 Sep 2023 10:10:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdC-005BRO-2L; Wed, 27 Sep 2023 10:10:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vadim Pasternak , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 21/27] platform/x86: mlx-platform: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:34 +0200 Message-Id: <20230927081040.2198742-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1872; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ILwP6aWMlmrtZMvtX94OUtej0Lbs5BrrWeR7MH34P5I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+N1hK4xqTWZzb0wX5RGhN9DfoJrNIMYbqrjv ZwMFb84pqmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjdQAKCRCPgPtYfRL+ TnDNCAC1bBjNG/Jzg+Ikvd+wXLT+hFG5iiOSoxvDjI+umm43Idt+j8Ih/NrtB/JiJHTuqRxaUVe 74nsieW0qMgNMmWyxjnQ/3sX+dm4Yr80X0Vy2Qn0XpcSyDmmNBRpdbFnbJy/ubljDw+umb/TSj0 CZQdsqOlxmL3zTaAQlw/sH0xIep3cmF1e9eqJlxlRa/fwq7M8FLJ1BWJ4Yt0ssaicF7tPeeiodl GoY9CgsYX+16Im+rvThqd2q6OcuqBs7CJiyjcVjw/qAVQ0wSnLTMsDUD12VrUph304JMlFsuSQW bF0bzMem4yI2wkSw68GMlaE6EYel5Smxz/jIUppOJ3tuQmjF 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/x86/mlx-platform.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 3d96dbf79a72..03ccadee35d0 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -6606,7 +6606,7 @@ static int mlxplat_probe(struct platform_device *pdev) return err; } -static int mlxplat_remove(struct platform_device *pdev) +static void mlxplat_remove(struct platform_device *pdev) { struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); @@ -6617,7 +6617,6 @@ static int mlxplat_remove(struct platform_device *pdev) mlxplat_pre_exit(priv); mlxplat_i2c_main_exit(priv); mlxplat_post_exit(); - return 0; } static const struct acpi_device_id mlxplat_acpi_table[] = { @@ -6633,7 +6632,7 @@ static struct platform_driver mlxplat_driver = { .probe_type = PROBE_FORCE_SYNCHRONOUS, }, .probe = mlxplat_probe, - .remove = mlxplat_remove, + .remove_new = mlxplat_remove, }; static int __init mlxplat_init(void) From patchwork Wed Sep 27 08:10:35 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: 13400333 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 74F06E810A9 for ; Wed, 27 Sep 2023 08:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbjI0ILH (ORCPT ); Wed, 27 Sep 2023 04:11:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbjI0ILB (ORCPT ); Wed, 27 Sep 2023 04:11:01 -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 6C75ACD5 for ; Wed, 27 Sep 2023 01:10:57 -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 1qlPdD-00088l-69; Wed, 27 Sep 2023 10:10:51 +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 1qlPdC-009I8B-Hp; Wed, 27 Sep 2023 10:10:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdC-005BRS-8f; Wed, 27 Sep 2023 10:10:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 22/27] platform/x86: sel3350-platform: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:35 +0200 Message-Id: <20230927081040.2198742-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1935; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kGFT7lS86ctdmmkMpaZWg5zGeyf+eOIqmv/jUI2LUYo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+N2rxvqD+lA8wv6scmPkLhb0cJvvDgUq/DRH HywXQsx0qGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjdgAKCRCPgPtYfRL+ ThxjCAC277WBTJ7ekvWUxkUJM+++B0FDDI0JW1ZCzWsDhRKXQ++9l2dq64Eqsc5CKqxZtsejGEr obgo10zU1xjeUNB9knrcx/+e5Qi8W9Uls0bwXxwIzFIc545sTE3rWjTO3pOQqDgRz4cOSFBH1Ea tCcY7JrSH3nh13VWr863FYmD8VTP88FfOzNZ72N7WDQI+WWL8F6PXHjAysggzy9E7fJUc8oEkMs l97t4x6qIrJ/pT1q1tZC0cPml5bAcuw3cu+NhkzcAtYWySHR3QvUtxaA3NSDHnYHBZihAfyVbG8 77HEsW+4M7RNYvoRBFIs2uDQg5HUFZqkNoDy4HXMFBRflF+/ 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/x86/sel3350-platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/sel3350-platform.c b/drivers/platform/x86/sel3350-platform.c index fa267d0d3778..d09e976e7148 100644 --- a/drivers/platform/x86/sel3350-platform.c +++ b/drivers/platform/x86/sel3350-platform.c @@ -218,15 +218,13 @@ static int sel3350_probe(struct platform_device *pdev) return rs; } -static int sel3350_remove(struct platform_device *pdev) +static void sel3350_remove(struct platform_device *pdev) { struct sel3350_data *sel3350 = platform_get_drvdata(pdev); platform_device_unregister(sel3350->leds_pdev); gpiod_remove_lookup_table(&sel3350_gpios_table); gpiod_remove_lookup_table(&sel3350_leds_table); - - return 0; } static const struct acpi_device_id sel3350_device_ids[] = { @@ -237,7 +235,7 @@ MODULE_DEVICE_TABLE(acpi, sel3350_device_ids); static struct platform_driver sel3350_platform_driver = { .probe = sel3350_probe, - .remove = sel3350_remove, + .remove_new = sel3350_remove, .driver = { .name = "sel3350-platform", .acpi_match_table = sel3350_device_ids, From patchwork Wed Sep 27 08:10:36 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: 13400342 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 83A85E810A3 for ; Wed, 27 Sep 2023 08:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230316AbjI0ILX (ORCPT ); Wed, 27 Sep 2023 04:11:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230224AbjI0ILC (ORCPT ); Wed, 27 Sep 2023 04:11: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 72A71CD8 for ; Wed, 27 Sep 2023 01:10:57 -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 1qlPdD-000892-Gs; Wed, 27 Sep 2023 10:10:51 +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 1qlPdC-009I8F-Pf; Wed, 27 Sep 2023 10:10:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdC-005BRV-GP; Wed, 27 Sep 2023 10:10:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Gerd Haeussler , Xing Tong Wu , Tobias Schaffner , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/27] platform/x86/siemens: simatic-ipc-batt: Simplify simatic_ipc_batt_remove() Date: Wed, 27 Sep 2023 10:10:36 +0200 Message-Id: <20230927081040.2198742-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4474; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uUXb4B5hrdHXmnbVK9GlXIsjnQhNbsw+/k4ukKVrWu0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+N4kwnW/Gz1Hb8gOU61vNE7HtCRpVAF86OF/ M/C+6XRZvCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjeAAKCRCPgPtYfRL+ TtseCACj0gQGeWiU0bRMvJ1gQPadWXcVIyxZ4FslwgDU1A1vYNjJrY7VDOKI2mf0WkCbiKzXMbj SRZEgEzPHToBhNmn5N8wVr2myrOHnM3b+dGZOcayR8ivOixBtHJFOdcwDFGyO0jNy1HK3WJ3e4U Zk+4C+9r6OziCcGW8ng5UqLLqvUHX3blw/TmP7o9XLPNrdUpQv+VM6MVRwYLeDCEWfYPG6hgSdD piaO23kG367PShsCxsSOLsz9ajcC29glH3Jm+szb28udEIjW3+ruzGShE9Gt+aw0qoWYvnb/cHi nbm6wBjeqog2eVq5XEkcTNIGZKmGKABbarxe8m5DwNeOd+qA 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Instead of unconditionally returning zero, let simatic_ipc_batt_remove() return no value. This is a preparation to convert the drivers using this function to struct platform_driver::remove_new(). Signed-off-by: Uwe Kleine-König --- drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c | 4 +++- .../platform/x86/siemens/simatic-ipc-batt-elkhartlake.c | 4 +++- drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c | 4 +++- drivers/platform/x86/siemens/simatic-ipc-batt.c | 7 ++++--- drivers/platform/x86/siemens/simatic-ipc-batt.h | 4 ++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c b/drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c index 8a67979d8f96..3e22a6bc9118 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c @@ -27,7 +27,9 @@ static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_127e = { static int simatic_ipc_batt_apollolake_remove(struct platform_device *pdev) { - return simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_127e); + simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_127e); + + return 0; } static int simatic_ipc_batt_apollolake_probe(struct platform_device *pdev) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c b/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c index 607d033911a2..9e08c659f27d 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c @@ -27,7 +27,9 @@ static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_bx_21a = { static int simatic_ipc_batt_elkhartlake_remove(struct platform_device *pdev) { - return simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_bx_21a); + simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_bx_21a); + + return 0; } static int simatic_ipc_batt_elkhartlake_probe(struct platform_device *pdev) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c b/drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c index a66107e0fe1e..19c302a68911 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c @@ -47,7 +47,9 @@ static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_bx_59a = { static int simatic_ipc_batt_f7188x_remove(struct platform_device *pdev) { - return simatic_ipc_batt_remove(pdev, batt_lookup_table); + simatic_ipc_batt_remove(pdev, batt_lookup_table); + + return 0; } static int simatic_ipc_batt_f7188x_probe(struct platform_device *pdev) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt.c b/drivers/platform/x86/siemens/simatic-ipc-batt.c index ef28c806b383..07cd4944de32 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt.c @@ -146,10 +146,9 @@ static const struct hwmon_chip_info simatic_ipc_batt_chip_info = { .info = simatic_ipc_batt_info, }; -int simatic_ipc_batt_remove(struct platform_device *pdev, struct gpiod_lookup_table *table) +void simatic_ipc_batt_remove(struct platform_device *pdev, struct gpiod_lookup_table *table) { gpiod_remove_lookup_table(table); - return 0; } EXPORT_SYMBOL_GPL(simatic_ipc_batt_remove); @@ -230,7 +229,9 @@ EXPORT_SYMBOL_GPL(simatic_ipc_batt_probe); static int simatic_ipc_batt_io_remove(struct platform_device *pdev) { - return simatic_ipc_batt_remove(pdev, NULL); + simatic_ipc_batt_remove(pdev, NULL); + + return 0; } static int simatic_ipc_batt_io_probe(struct platform_device *pdev) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt.h b/drivers/platform/x86/siemens/simatic-ipc-batt.h index 4545cd3e3026..89891db26a2c 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt.h +++ b/drivers/platform/x86/siemens/simatic-ipc-batt.h @@ -14,7 +14,7 @@ int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_table *table); -int simatic_ipc_batt_remove(struct platform_device *pdev, - struct gpiod_lookup_table *table); +void simatic_ipc_batt_remove(struct platform_device *pdev, + struct gpiod_lookup_table *table); #endif /* _SIMATIC_IPC_BATT_H */ From patchwork Wed Sep 27 08:10:37 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: 13400330 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 DA0F8E810A5 for ; Wed, 27 Sep 2023 08:11:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230180AbjI0ILF (ORCPT ); Wed, 27 Sep 2023 04:11:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbjI0ILB (ORCPT ); Wed, 27 Sep 2023 04:11:01 -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 9F5D1CCD for ; Wed, 27 Sep 2023 01:10:56 -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 1qlPdD-00089G-KC; Wed, 27 Sep 2023 10:10:51 +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 1qlPdD-009I8I-0h; Wed, 27 Sep 2023 10:10:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdC-005BRa-NJ; Wed, 27 Sep 2023 10:10:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Gerd Haeussler , Xing Tong Wu , Tobias Schaffner , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 24/27] platform/x86/siemens: simatic-ipc-batt: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:37 +0200 Message-Id: <20230927081040.2198742-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1897; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=U+EVuue4dcy4JngvRLYcxQ86hJmTobawp5GDBK/mQb4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+N52b9a1e/I3FLntCEoj7l2JDKoiPZ0brnVI lt0GXyKq5eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjeQAKCRCPgPtYfRL+ TprgCACcjwpGAPSTmBGWtJNfSMfp6c8P0VwUD+Wg581erlXeDhKPJIGJpMRiPQL0GiL7Emy0NU0 +aqdvMWQiGS2YLJ8yHgnCetrGOep1+iXklzs8Yy95KhTeiZfFtU6V21ru58M8QLKBwFDBHo1S+x qgpup8xfuuehpLJpXCoqS4siXA81P6CCUIIwi96CpvD8w4xZJZTmLbyoYjaCcZ7/v8INlMRh6H1 EN82iqkFKozLBc+RXdpbRWhULLxAI2NDW4EtkDQoEEVGjH7B2Sdi8Egmk3XxDfo1P/FSU/Ol2c5 f0pjp//0eLuwjMMIEoauvMw9oAAW7X6MpU8LFGS+XB/FAt6B 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/x86/siemens/simatic-ipc-batt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt.c b/drivers/platform/x86/siemens/simatic-ipc-batt.c index 07cd4944de32..c6dd263b4ee3 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt.c @@ -227,11 +227,9 @@ int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_tab } EXPORT_SYMBOL_GPL(simatic_ipc_batt_probe); -static int simatic_ipc_batt_io_remove(struct platform_device *pdev) +static void simatic_ipc_batt_io_remove(struct platform_device *pdev) { simatic_ipc_batt_remove(pdev, NULL); - - return 0; } static int simatic_ipc_batt_io_probe(struct platform_device *pdev) @@ -241,7 +239,7 @@ static int simatic_ipc_batt_io_probe(struct platform_device *pdev) static struct platform_driver simatic_ipc_batt_driver = { .probe = simatic_ipc_batt_io_probe, - .remove = simatic_ipc_batt_io_remove, + .remove_new = simatic_ipc_batt_io_remove, .driver = { .name = KBUILD_MODNAME, }, From patchwork Wed Sep 27 08:10: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: 13400332 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 7FCB8E810A7 for ; Wed, 27 Sep 2023 08:11:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230158AbjI0ILG (ORCPT ); Wed, 27 Sep 2023 04:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbjI0ILB (ORCPT ); Wed, 27 Sep 2023 04:11:01 -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 84056CCA for ; Wed, 27 Sep 2023 01:10:56 -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 1qlPdD-00089k-MM; Wed, 27 Sep 2023 10:10:51 +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 1qlPdD-009I8M-7q; Wed, 27 Sep 2023 10:10:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdC-005BRe-Uh; Wed, 27 Sep 2023 10:10:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Gerd Haeussler , Xing Tong Wu , Tobias Schaffner , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/27] platform/x86/siemens: simatic-ipc-batt-apollolake: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:38 +0200 Message-Id: <20230927081040.2198742-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1984; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oosda01/3Jzx9HSa7idBXZZBh6OciqDqaWd/R9AvMS4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+N6TedDwJ3l9N4cpk7cRihO9WdQtoO805D0r 0yEa41AqKSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjegAKCRCPgPtYfRL+ TszGCAC7fRixYt1LQeBFKAA18nMJFEEm3PcA0ruXY9bg1Iz1od9V6J7me1IOXCLjKHiaHYahIx3 2QTrA3SYMn3toK3hLnOZK7cpjJHNARp9XkiCfI5wZDubf1a6wNC4I5opa2NdE4bmzGFSYlznLu4 PNA6Uajs9BOkpSW8WjI/sLv9/6ali0hEY6rBTzcujyteWyLvtfLT8Q0Bp3z8EZow3ySgMSY3pY6 cfaxwmcJkdrMeqW64i+5ffxRm5RTOLEgKViWODaOZUTmP9AkLvwac8nxnHpez97cDtXmfBLgU37 c6kbaS5Cw5KIXdSpTZp07WkwzpNSHBBQHiVADnnlWsKARDxZ 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/x86/siemens/simatic-ipc-batt-apollolake.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c b/drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c index 3e22a6bc9118..31a139d87d9a 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c @@ -25,11 +25,9 @@ static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_127e = { }, }; -static int simatic_ipc_batt_apollolake_remove(struct platform_device *pdev) +static void simatic_ipc_batt_apollolake_remove(struct platform_device *pdev) { simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_127e); - - return 0; } static int simatic_ipc_batt_apollolake_probe(struct platform_device *pdev) @@ -39,7 +37,7 @@ static int simatic_ipc_batt_apollolake_probe(struct platform_device *pdev) static struct platform_driver simatic_ipc_batt_driver = { .probe = simatic_ipc_batt_apollolake_probe, - .remove = simatic_ipc_batt_apollolake_remove, + .remove_new = simatic_ipc_batt_apollolake_remove, .driver = { .name = KBUILD_MODNAME, }, From patchwork Wed Sep 27 08:10: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: 13400337 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 86795E810A4 for ; Wed, 27 Sep 2023 08:11:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230300AbjI0ILT (ORCPT ); Wed, 27 Sep 2023 04:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230220AbjI0ILB (ORCPT ); Wed, 27 Sep 2023 04:11:01 -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 6EB0FCD6 for ; Wed, 27 Sep 2023 01:10:57 -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 1qlPdD-0008AS-W5; Wed, 27 Sep 2023 10:10:52 +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 1qlPdD-009I8R-Dx; Wed, 27 Sep 2023 10:10:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdD-005BRi-4g; Wed, 27 Sep 2023 10:10:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Gerd Haeussler , Xing Tong Wu , Tobias Schaffner , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 26/27] platform/x86/siemens: simatic-ipc-batt-elkhartlake: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:39 +0200 Message-Id: <20230927081040.2198742-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2000; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=atKDlgH5RJpKWqL6VwqbwRwC4qoK6wHDECsivGMaAKw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+N7B83ZmEZGbV1cN3PT09dXprrKhuV4blhZP s19OFSZpM2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjewAKCRCPgPtYfRL+ TslTB/47Z6/d9rro1h89YQz4mgs2/rhQEbsr8CzoF1mhAUWVk3qJxwDREL+8WcUcRH1Hvkuxous E/FCzpKFOFHlKjZkeDgSvFZy0WUr9Ci96pIS/IR5zqzc3KmhVCgCgmKa+lwc6x1LKI2JAjXanvL Jk7xNsvu32oQsC2rOhUiktn3F1FDmK+/4WV4xLLZY7X16HdDnJlh5ykzy0rwMzveHzyZ+XYx1yo 5FHvjvhg/nBFcH8mcuMtJ9emPl6D+Puz2cJXKQvkcpJdAyJyYgwyfnOtwDwxr2g1vjz/DTZ9Yt/ /XecXtw7nkfFLete3YlLL/bF1v/CHvu8jYIlH/+HAGsAKntZ 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c b/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c index 9e08c659f27d..a7676f224075 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c @@ -25,11 +25,9 @@ static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_bx_21a = { }, }; -static int simatic_ipc_batt_elkhartlake_remove(struct platform_device *pdev) +static void simatic_ipc_batt_elkhartlake_remove(struct platform_device *pdev) { simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_bx_21a); - - return 0; } static int simatic_ipc_batt_elkhartlake_probe(struct platform_device *pdev) @@ -39,7 +37,7 @@ static int simatic_ipc_batt_elkhartlake_probe(struct platform_device *pdev) static struct platform_driver simatic_ipc_batt_driver = { .probe = simatic_ipc_batt_elkhartlake_probe, - .remove = simatic_ipc_batt_elkhartlake_remove, + .remove_new = simatic_ipc_batt_elkhartlake_remove, .driver = { .name = KBUILD_MODNAME, }, From patchwork Wed Sep 27 08:10: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: 13400334 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 111D7E810A2 for ; Wed, 27 Sep 2023 08:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbjI0ILH (ORCPT ); Wed, 27 Sep 2023 04:11:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230212AbjI0ILB (ORCPT ); Wed, 27 Sep 2023 04:11:01 -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 110A6CD2 for ; Wed, 27 Sep 2023 01:10:56 -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 1qlPdE-0008Bd-8B; Wed, 27 Sep 2023 10:10:52 +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 1qlPdD-009I8V-Kp; Wed, 27 Sep 2023 10:10:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qlPdD-005BRm-BW; Wed, 27 Sep 2023 10:10:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Gerd Haeussler , Xing Tong Wu , Tobias Schaffner , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 27/27] platform/x86/siemens: simatic-ipc-batt-f7188x: Convert to platform remove callback returning void Date: Wed, 27 Sep 2023 10:10:40 +0200 Message-Id: <20230927081040.2198742-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> References: <20230927081040.2198742-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1921; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ppuhwm0gU6+2BGzuuvFr4fZQMjeNK1Hrm/CuJZG8tv4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlE+N8ZBf0B8Ls8/0BGKt+T6Vq2yd6huAyrsjPr JIXMiX14lWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRPjfAAKCRCPgPtYfRL+ ThqLB/47y3ScJPN+FC65DzwCmtW7dqtILGPC5gzujTdltNJLOSqjhrG2ilqZlNjGAeZNAPYiPSq E2aRJ9nl/904GtO23D7r0F8XaE7e6XD5MtVVbxz+XTjE4tHefbuMwqjDW16t6OeLBHbrwpzdAV5 QCF5QrBAQr29dqLc8RpHhy2367CgLq1tqEf6h4P6u0YzD+dQWgNuvU4SiGeahSnDKSmw5bp4dPO gfFcncvsg29Sw4PSK7LcmCX+uApEiNOuih/OvcydlOti8FfI6APMwtNqKbNxKJsA7WjhbKEFD3W SyfvGzFAMQPrjKdGwzQbwbVLgdKWUhHyzFx664mOG9N0TR9T 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: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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/platform/x86/siemens/simatic-ipc-batt-f7188x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c b/drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c index 19c302a68911..5e77e05fdb5d 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c @@ -45,11 +45,9 @@ static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_bx_59a = { } }; -static int simatic_ipc_batt_f7188x_remove(struct platform_device *pdev) +static void simatic_ipc_batt_f7188x_remove(struct platform_device *pdev) { simatic_ipc_batt_remove(pdev, batt_lookup_table); - - return 0; } static int simatic_ipc_batt_f7188x_probe(struct platform_device *pdev) @@ -75,7 +73,7 @@ static int simatic_ipc_batt_f7188x_probe(struct platform_device *pdev) static struct platform_driver simatic_ipc_batt_driver = { .probe = simatic_ipc_batt_f7188x_probe, - .remove = simatic_ipc_batt_f7188x_remove, + .remove_new = simatic_ipc_batt_f7188x_remove, .driver = { .name = KBUILD_MODNAME, },