From patchwork Wed Oct 4 13:12: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: 13408760 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 5EA88E7B618 for ; Wed, 4 Oct 2023 13:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233003AbjJDNNZ (ORCPT ); Wed, 4 Oct 2023 09:13:25 -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 S242555AbjJDNNX (ORCPT ); Wed, 4 Oct 2023 09:13:23 -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 6C663E4 for ; Wed, 4 Oct 2023 06:13:20 -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 1qo1gV-0006nP-FW; Wed, 04 Oct 2023 15:13:03 +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 1qo1gU-00B2gx-Hg; Wed, 04 Oct 2023 15:13:02 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gU-008zC5-89; Wed, 04 Oct 2023 15:13:02 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Dinh Nguyen , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 01/21] EDAC/altera: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:34 +0200 Message-Id: <20231004131254.2673842-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2628; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oy4IAj9MLr9U5T1p6VUQW6y6sfNQWyNYMdkG/zPkpik=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSN4Q1qphM/c0fgnjHycf/3nXdlKrQtNA20O 6CKogaM8eeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kjQAKCRCPgPtYfRL+ TrQyCACMg+N3yvr9VErRg/qjkm4YqCOPn8kC9MZ+tTyH85O+rcW3trS84e9cwZHB+T4LTAvDkjJ DQTehZJOBSuacc8oempSM3kSgzUGDhC4ydhLErFIJ7bLneSDf0gnlKZXw+PHW/qGCqVZ3wdvTlh RoDEZ4tXgJjtuK6Wt8cE6wplMO6XUzOtEUKDrrChHyU3os3JUGcD53SZHovE/nDMlQ+2VATK76K 9b0qcHtbAITYwxs/giuTRpMv97lRYEatLsVlLMBENNh1u91VXEUJD1Ufh76RjVRCaSUqfzABIe/ 7t3eU7T/3aidUmRgWrtyiwiitk5BV/zghmZ+kY4jE2a0vPgU 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/altera_edac.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index 8b31cd54bdb6..09169f3726f4 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -459,15 +459,13 @@ static int altr_sdram_probe(struct platform_device *pdev) return res; } -static int altr_sdram_remove(struct platform_device *pdev) +static void altr_sdram_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); platform_set_drvdata(pdev, NULL); - - return 0; } /* @@ -489,7 +487,7 @@ static const struct dev_pm_ops altr_sdram_pm_ops = { static struct platform_driver altr_sdram_edac_driver = { .probe = altr_sdram_probe, - .remove = altr_sdram_remove, + .remove_new = altr_sdram_remove, .driver = { .name = "altr_sdram_edac", #ifdef CONFIG_PM @@ -812,7 +810,7 @@ static int altr_edac_device_probe(struct platform_device *pdev) return res; } -static int altr_edac_device_remove(struct platform_device *pdev) +static void altr_edac_device_remove(struct platform_device *pdev) { struct edac_device_ctl_info *dci = platform_get_drvdata(pdev); struct altr_edac_device_dev *drvdata = dci->pvt_info; @@ -820,13 +818,11 @@ static int altr_edac_device_remove(struct platform_device *pdev) debugfs_remove_recursive(drvdata->debugfs_dir); edac_device_del_device(&pdev->dev); edac_device_free_ctl_info(dci); - - return 0; } static struct platform_driver altr_edac_device_driver = { .probe = altr_edac_device_probe, - .remove = altr_edac_device_remove, + .remove_new = altr_edac_device_remove, .driver = { .name = "altr_edac_device", .of_match_table = altr_edac_device_of_match, From patchwork Wed Oct 4 13:12: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: 13408761 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 31F90E7B615 for ; Wed, 4 Oct 2023 13:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242553AbjJDNNX (ORCPT ); Wed, 4 Oct 2023 09:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242554AbjJDNNW (ORCPT ); Wed, 4 Oct 2023 09:13:22 -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 4DD40C4 for ; Wed, 4 Oct 2023 06:13:18 -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 1qo1gV-0006nv-ME; Wed, 04 Oct 2023 15:13:03 +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 1qo1gV-00B2h0-7T; Wed, 04 Oct 2023 15:13:03 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gU-008zC9-U8; Wed, 04 Oct 2023 15:13:02 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Jan Luebbe , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/21] EDAC/armada_xp: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:35 +0200 Message-Id: <20231004131254.2673842-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2464; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FRztW3eivwDxjzN9/3jMRMZwfESZ8EFnfLBPbbErm0M=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTZlP6Om1aMCmu2MxmVLeh69LelYOfW9PgaM467HzknF EbYlUzpZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAiaZvZ/3BkhbXsnDSbfdmz BCftg731i9ftkFXKVv5o9D5b4mJ/Q+zyZDsL1jmHFx9zX7J6VWnChpUMFpU/ohNLbj5VV7FNivD /vCVut02exYbdO5fHmZ2KMEsvnN5ttVvw98ozvx85vcp0O577YINP9BV+hkbbHa59fo98FZ8oGz tbNBwV5N+g4dnxuIozf+nNQGv9pY7VzlVKT9idJErXikWvW2+3StBatG7rF+0r/CYq0uVn1r/Wl NG8y/f29+/ku+KLtllqL0xsuVizX+jNd8e3OlpTntyWTYtTE74pduRlTuS73uUV1y+bREpf6+y/ eMI97N7fBZW629L/s+qJCgYX8B+vmXa097JokkiqaaQqAA== 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/armada_xp_edac.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/edac/armada_xp_edac.c b/drivers/edac/armada_xp_edac.c index c4bd2fb9c46b..5bcd34f23baf 100644 --- a/drivers/edac/armada_xp_edac.c +++ b/drivers/edac/armada_xp_edac.c @@ -351,20 +351,18 @@ static int axp_mc_probe(struct platform_device *pdev) return 0; } -static int axp_mc_remove(struct platform_device *pdev) +static void axp_mc_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); platform_set_drvdata(pdev, NULL); - - return 0; } static struct platform_driver axp_mc_driver = { .probe = axp_mc_probe, - .remove = axp_mc_remove, + .remove_new = axp_mc_remove, .driver = { .name = "armada_xp_mc_edac", .of_match_table = of_match_ptr(axp_mc_of_match), @@ -564,7 +562,7 @@ static int aurora_l2_probe(struct platform_device *pdev) return 0; } -static int aurora_l2_remove(struct platform_device *pdev) +static void aurora_l2_remove(struct platform_device *pdev) { struct edac_device_ctl_info *dci = platform_get_drvdata(pdev); #ifdef CONFIG_EDAC_DEBUG @@ -575,13 +573,11 @@ static int aurora_l2_remove(struct platform_device *pdev) edac_device_del_device(&pdev->dev); edac_device_free_ctl_info(dci); platform_set_drvdata(pdev, NULL); - - return 0; } static struct platform_driver aurora_l2_driver = { .probe = aurora_l2_probe, - .remove = aurora_l2_remove, + .remove_new = aurora_l2_remove, .driver = { .name = "aurora_l2_edac", .of_match_table = of_match_ptr(aurora_l2_of_match), From patchwork Wed Oct 4 13:12: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: 13408771 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 2960CE7B61B for ; Wed, 4 Oct 2023 13:13:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232819AbjJDNNa (ORCPT ); Wed, 4 Oct 2023 09:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242576AbjJDNNa (ORCPT ); Wed, 4 Oct 2023 09:13:30 -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 554A8A1 for ; Wed, 4 Oct 2023 06:13:27 -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 1qo1gW-0006oK-PP; Wed, 04 Oct 2023 15:13:04 +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 1qo1gV-00B2h5-SV; Wed, 04 Oct 2023 15:13:03 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gV-008zCC-J2; Wed, 04 Oct 2023 15:13:03 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Stefan Schaeckeler , James Morse , Mauro Carvalho Chehab , Robert Richter , Joel Stanley , Andrew Jeffery , linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, kernel@pengutronix.de Subject: [PATCH 03/21] EDAC/aspeed: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:36 +0200 Message-Id: <20231004131254.2673842-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1693; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ZIFXoJp34XhUaOmwr7EiRfSpR5K5sF36mP6Xs3mQ+WQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSQJEe2NPiTtc7wNXKUmjqpmvXoVn9dqEQkJ Smd3Xb76DKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kkAAKCRCPgPtYfRL+ Tr58B/9uFt+itrf+KEGigNR8Uybiz/Jw9pAO9f9gW6/b1FVUuT9n3RJRmeyEGFCH00vS3ZUMiSb HhrFmrvCaKVdGeCoPOQoye6mSN6oMR1/dCfGWgcGwCsUx/G3KNXJbM04NWY4/Yt3GRz9DzZMJ7C qJUSrwW8o2SZuBZ90wkDgAn80e8GQahpkEPgLe0nX4qXjLvffoKFVxvwQX886HBse4RlDe+SUyK SSGop2D0RWRMLgsN0Lamq1u8TwWLjyH1UKSvgTv0Fqau5wtgJ7YU7NqMySdd6ln0GVYN+0C6DVZ qfpYU8OE3pQCnD/Z8xZRxDlJkxmQw5cni0CJ9imvEe0CNgR2 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/aspeed_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c index 6bd5f8815919..157a480eb761 100644 --- a/drivers/edac/aspeed_edac.c +++ b/drivers/edac/aspeed_edac.c @@ -357,7 +357,7 @@ static int aspeed_probe(struct platform_device *pdev) } -static int aspeed_remove(struct platform_device *pdev) +static void aspeed_remove(struct platform_device *pdev) { struct mem_ctl_info *mci; @@ -369,8 +369,6 @@ static int aspeed_remove(struct platform_device *pdev) mci = edac_mc_del_mc(&pdev->dev); if (mci) edac_mc_free(mci); - - return 0; } @@ -389,7 +387,7 @@ static struct platform_driver aspeed_driver = { .of_match_table = aspeed_of_match }, .probe = aspeed_probe, - .remove = aspeed_remove + .remove_new = aspeed_remove }; module_platform_driver(aspeed_driver); From patchwork Wed Oct 4 13:12: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: 13408762 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 B421DE7B617 for ; Wed, 4 Oct 2023 13:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242551AbjJDNNZ (ORCPT ); Wed, 4 Oct 2023 09:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242559AbjJDNNX (ORCPT ); Wed, 4 Oct 2023 09:13:23 -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 D84D3B0 for ; Wed, 4 Oct 2023 06:13:20 -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 1qo1gY-0006rL-4t; Wed, 04 Oct 2023 15:13:06 +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 1qo1gX-00B2hD-IC; Wed, 04 Oct 2023 15:13:05 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gX-008zCH-8l; Wed, 04 Oct 2023 15:13:05 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Shravan Kumar Ramani , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/21] EDAC/bluefield: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:37 +0200 Message-Id: <20231004131254.2673842-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1803; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PMBI6qSiajpSYrnMxm0jS+FOpcUkXI9dxvfsSxctGP4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSRV3B7b99Hl31TeGR/NFmJ5SWO/kH+sjw7r F76y1ysROOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kkQAKCRCPgPtYfRL+ ToayB/44PV8pXNo+Hx8l03egFTgSflUWUTcijM5I+KyP9VrLCa6NDjtaQQG9pNxQ+JNH3txBtoT ff2kuNksLXY92rxoeYErnYNj80/7BYSVolWOxM1llVWfrkkvgsAF/jJJRTzJKQsYeAKB1fvkZKQ a4MCTCAAobi7DDePhzq26ZFrfPqdvH2YJC8QGr+hUK5gZ88ZJE+e81oqbG3e9ASJWNHP+dsKGNA livHscPW89Rb3iKj82NLM3vGarooQp78+BchE+ycdWBjV2DMaA6urKyDcy7//QqdM4w83fexpKQ LK78hkbs351tH17XriY5MYYDEohixlJeGYB7+qKmj8YHz9Lv 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/bluefield_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/bluefield_edac.c b/drivers/edac/bluefield_edac.c index e4736eb37bfb..5b3164560648 100644 --- a/drivers/edac/bluefield_edac.c +++ b/drivers/edac/bluefield_edac.c @@ -323,14 +323,12 @@ static int bluefield_edac_mc_probe(struct platform_device *pdev) } -static int bluefield_edac_mc_remove(struct platform_device *pdev) +static void bluefield_edac_mc_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); - - return 0; } static const struct acpi_device_id bluefield_mc_acpi_ids[] = { @@ -346,7 +344,7 @@ static struct platform_driver bluefield_edac_mc_driver = { .acpi_match_table = bluefield_mc_acpi_ids, }, .probe = bluefield_edac_mc_probe, - .remove = bluefield_edac_mc_remove, + .remove_new = bluefield_edac_mc_remove, }; module_platform_driver(bluefield_edac_mc_driver); From patchwork Wed Oct 4 13:12: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: 13408763 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 15CB7E7B614 for ; Wed, 4 Oct 2023 13:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242559AbjJDNNZ (ORCPT ); Wed, 4 Oct 2023 09:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242556AbjJDNNX (ORCPT ); Wed, 4 Oct 2023 09:13:23 -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 99AC1A9 for ; Wed, 4 Oct 2023 06:13:20 -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 1qo1gY-0006u9-QD; Wed, 04 Oct 2023 15:13:06 +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 1qo1gY-00B2hI-DS; Wed, 04 Oct 2023 15:13:06 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gY-008zCL-4B; Wed, 04 Oct 2023 15:13:06 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/21] EDAC/cell: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:38 +0200 Message-Id: <20231004131254.2673842-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1662; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PnQNVdNQ2vWfcp61GZbI9oORO4my2PKzMEo+pgjYL4k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSSHiDxX6IMHL5FAN+h9mUC1svQNVXqqGk9G KCI7bjzF7KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kkgAKCRCPgPtYfRL+ TtESB/4/6CYCGVA7Tx/U5DrJhILmymS4M5Sg4/909UEEh9FXjcDx0bOqjw0NHqKl0dZPkfsllb9 n1FsKavzdb083rN7JNvYlDeQBFWnthn9DDJ2XOzxy3oiitUeiEqL3mi6RiymmxW2DMJ+haJdUXL pnSN62iXsg0eR9kmtofNjdrTCKymQvZQNV5nmRsLFYbl4DQsLmWoDvZyicu4GUZahNhtVIrFHhr 81GN437Dd8Qt9wLC3JiMkcT1SUde/wBynYt/HIlzzWGtWOGr9nYZP08+5gpy+IJRfXUjDuaZIzU R84Ho4MbqrNMFYtdFWvtrvzPlsZ2bEvnh0QxolTTiR/yCVXE 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/cell_edac.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/edac/cell_edac.c b/drivers/edac/cell_edac.c index bc1f3416400e..2000f66fbf5c 100644 --- a/drivers/edac/cell_edac.c +++ b/drivers/edac/cell_edac.c @@ -234,12 +234,11 @@ static int cell_edac_probe(struct platform_device *pdev) return 0; } -static int cell_edac_remove(struct platform_device *pdev) +static void cell_edac_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = edac_mc_del_mc(&pdev->dev); if (mci) edac_mc_free(mci); - return 0; } static struct platform_driver cell_edac_driver = { @@ -247,7 +246,7 @@ static struct platform_driver cell_edac_driver = { .name = "cbe-mic", }, .probe = cell_edac_probe, - .remove = cell_edac_remove, + .remove_new = cell_edac_remove, }; static int __init cell_edac_init(void) From patchwork Wed Oct 4 13:12: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: 13408766 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 4D7A2E7B60F for ; Wed, 4 Oct 2023 13:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242564AbjJDNN0 (ORCPT ); Wed, 4 Oct 2023 09:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232819AbjJDNNZ (ORCPT ); Wed, 4 Oct 2023 09:13:25 -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 412F8B0 for ; Wed, 4 Oct 2023 06:13:22 -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 1qo1gZ-0006vL-SK; Wed, 04 Oct 2023 15:13:07 +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 1qo1gZ-00B2hN-9p; Wed, 04 Oct 2023 15:13:07 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gZ-008zCP-0X; Wed, 04 Oct 2023 15:13:07 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/21] EDAC/cpc925: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:39 +0200 Message-Id: <20231004131254.2673842-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-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=jY58XnDPJ50uKl8qv1rIt1AmbxZGPnBKWALunQb2G4s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSYnbEjpyqoZQf83FOAwTRPJ79NwPHqgS9sk gYaxCsnmbSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kmAAKCRCPgPtYfRL+ TiEbB/43kWNtomA9QOZBCGDMAnu1MikIs7dqhN1yvcAKbJL4m5lYbw/QaZCslolQKvyE2zMGFAF yQkTUkR1Vls9Loasur3IjRPxuBU9F/VAYK/jqce08mNWJAtShtN3cEHg225P/FobWNuu2G5JwMq f61ZWTTWWJHaYJdYR5i8cwagIV0f4N4M2jrYC8fXHGqnAEgfMAek0WGfK0rodO953EC0JSyP2w5 1q2OFgCyMgSWd3FnzYQwotGuclynJz6YGqI7rksQRobbZN7oJnRIDJ/BSyMmw+nbvTnxX5J5CBY ZRZbhuF2a7wKJS4Km+rz5OGiBHZCwGYTwWtCF6iPbSuAnaiJ 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/cpc925_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c index 9797e6d60dde..5075dc7526e3 100644 --- a/drivers/edac/cpc925_edac.c +++ b/drivers/edac/cpc925_edac.c @@ -1010,7 +1010,7 @@ static int cpc925_probe(struct platform_device *pdev) return res; } -static int cpc925_remove(struct platform_device *pdev) +static void cpc925_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); @@ -1023,13 +1023,11 @@ static int cpc925_remove(struct platform_device *pdev) edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); - - return 0; } static struct platform_driver cpc925_edac_driver = { .probe = cpc925_probe, - .remove = cpc925_remove, + .remove_new = cpc925_remove, .driver = { .name = "cpc925_edac", } From patchwork Wed Oct 4 13:12: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: 13408765 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 A6B76E7B61C for ; Wed, 4 Oct 2023 13:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242563AbjJDNN0 (ORCPT ); Wed, 4 Oct 2023 09:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242565AbjJDNNY (ORCPT ); Wed, 4 Oct 2023 09:13:24 -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 1838198 for ; Wed, 4 Oct 2023 06:13:21 -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 1qo1gZ-0006vM-TN; Wed, 04 Oct 2023 15:13:07 +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 1qo1gZ-00B2hQ-G4; Wed, 04 Oct 2023 15:13:07 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gZ-008zCX-6c; Wed, 04 Oct 2023 15:13:07 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Lei Wang , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/21] EDAC/dmc520: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:40 +0200 Message-Id: <20231004131254.2673842-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1793; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=k1Kzh0qSpovLvELPe0ysXEHi7N+aWjG0Q/a5F2bqakk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSeM7qrt93yeAc7dCnrqPNKUv2R3BCD3X66G 2nkWLkmhU2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kngAKCRCPgPtYfRL+ TvKMB/4tzgb+EDeFVskfyHpRpJHfw7PYzZq2b6kehpadLgwl+/+n60gWQnXAjq31b050q1bBw1v MBFMR4/VvtM5K9ISt4cdoVShzPEq0rd06uRGq1VsQd4zy90X0LMH31rK9tjsRTaGEIRHvhkXQFu NTmbuNyzy9PB4eAar/b8OAjSnyBNqVFK8hn2jgMHVfoQk9wwWQE7qNIvkUTI/T8tHrV9RchgYmk J8hF7MBz1BEJsZFb+R1AE7fPWCTCwi29edaFcSqJP+RCIVIeFCjMRMsKLWAVG6vc3Htg3KZYmMM SDdcG20M+tRP34ZDf7X6l1HGT1WsJrxFV9MpzaLuOuqWLfYP 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/dmc520_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/dmc520_edac.c b/drivers/edac/dmc520_edac.c index 1fa5ca57e9ec..4e30b989a1a4 100644 --- a/drivers/edac/dmc520_edac.c +++ b/drivers/edac/dmc520_edac.c @@ -602,7 +602,7 @@ static int dmc520_edac_probe(struct platform_device *pdev) return ret; } -static int dmc520_edac_remove(struct platform_device *pdev) +static void dmc520_edac_remove(struct platform_device *pdev) { u32 reg_val, idx, irq_mask_all = 0; struct mem_ctl_info *mci; @@ -626,8 +626,6 @@ static int dmc520_edac_remove(struct platform_device *pdev) edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); - - return 0; } static const struct of_device_id dmc520_edac_driver_id[] = { @@ -644,7 +642,7 @@ static struct platform_driver dmc520_edac_driver = { }, .probe = dmc520_edac_probe, - .remove = dmc520_edac_remove + .remove_new = dmc520_edac_remove }; module_platform_driver(dmc520_edac_driver); From patchwork Wed Oct 4 13:12: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: 13408757 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 B3BF9E7B60F for ; Wed, 4 Oct 2023 13:13:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242552AbjJDNNX (ORCPT ); Wed, 4 Oct 2023 09:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242555AbjJDNNW (ORCPT ); Wed, 4 Oct 2023 09:13:22 -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 C5EECD8 for ; Wed, 4 Oct 2023 06:13:18 -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 1qo1gb-0006zw-6j; Wed, 04 Oct 2023 15:13:09 +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 1qo1ga-00B2hV-KV; Wed, 04 Oct 2023 15:13:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1ga-008zCc-BG; Wed, 04 Oct 2023 15:13:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Andre Przywara , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/21] EDAC/highbank_l2: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:41 +0200 Message-Id: <20231004131254.2673842-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1723; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1EAv6PepNkeInYp+c7czYEYF2N0Uzxxw7rLNNX7w3Mw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSg+2nWfz1Pf41627/b4xQpkJ/MpPM8PweNs mTmUEJGqKyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1koAAKCRCPgPtYfRL+ Tg5FB/0f2mZLgYspvRkAXfu9CjXLgUvtfyC5wFDJwo5F1H9P02Ra8pSomwIyLXs5hyOx5ldqRX3 2Nkk9ZlxR7a6ssCgOrwbMoau0pNhPgRIYj+szxsYcYGEzm750nn+pVmyoIQ32zprwBe9n0itB2P CoDHhDAKGoMI0IB5ftwbJTVKtQ/Xogu4TIDzKZt+TNack9//VeTx1h3G3MVvKdcX4viCZaMSfHa govoXawnIws5prs4m3c4kYE78DUmdtvfVCGQQO49rytivVcO893miCQxwLgTmWd15ZSBFdN9nyt Ow4JHigjnk9jmjSbdcID9SsJMf23rQuoVzqgPF+sWel6PEAv 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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: Andre Przywara --- drivers/edac/highbank_l2_edac.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/edac/highbank_l2_edac.c b/drivers/edac/highbank_l2_edac.c index 140d4431bd0d..5646c049a934 100644 --- a/drivers/edac/highbank_l2_edac.c +++ b/drivers/edac/highbank_l2_edac.c @@ -118,18 +118,17 @@ static int highbank_l2_err_probe(struct platform_device *pdev) return res; } -static int highbank_l2_err_remove(struct platform_device *pdev) +static void highbank_l2_err_remove(struct platform_device *pdev) { struct edac_device_ctl_info *dci = platform_get_drvdata(pdev); edac_device_del_device(&pdev->dev); edac_device_free_ctl_info(dci); - return 0; } static struct platform_driver highbank_l2_edac_driver = { .probe = highbank_l2_err_probe, - .remove = highbank_l2_err_remove, + .remove_new = highbank_l2_err_remove, .driver = { .name = "hb_l2_edac", .of_match_table = hb_l2_err_of_match, From patchwork Wed Oct 4 13:12: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: 13408759 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 7DB27E7B616 for ; Wed, 4 Oct 2023 13:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242554AbjJDNNY (ORCPT ); Wed, 4 Oct 2023 09:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233003AbjJDNNW (ORCPT ); Wed, 4 Oct 2023 09:13:22 -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 8630FDC for ; Wed, 4 Oct 2023 06:13:19 -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 1qo1gb-0006zy-D1; Wed, 04 Oct 2023 15:13:09 +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 1qo1gb-00B2hY-01; Wed, 04 Oct 2023 15:13:09 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1ga-008zCf-Mp; Wed, 04 Oct 2023 15:13:08 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Andre Przywara , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/21] EDAC/highbank_mc: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:42 +0200 Message-Id: <20231004131254.2673842-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1672; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ugJHst+g08gCukSrRsk2DtiRLBBhprMkajtpocSUlHw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWShYn1WFOUBHQGonYGNGYP71JF9fFTb+pJPR xCYliO/k8WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1koQAKCRCPgPtYfRL+ Tm+pB/9qhThah6iLHB7g7Ps/p4Awq7Ebuy1/2LRIcVjQd53ttVHGzct1tgBMhhEMtZ6PccRMQYe u4M6iDgQauHIWkcaQYxwOxV/27LjpAc2rFiHLWpaKN4vIFjXLu38UL6IZ5ikD5zIq7xEbYQyaCx WuVCcNHgVJ2zitdEbzEcBBx+HrYReI/bkFqD1qqj2V/IYoScPUYJaf8Iy5I9iQaHQxJ8vgvLOAl 1+rtKzi1ZEwfbn9MGZoYgOdbypvAlu3Fb7tfUF5TwViMx4EqJwIJl3MSN78US6PWhtUBWBbWRUU BSZyq+yglHzhhev6858GKxC7ZH0pMj4xLD/5jzPC+U+1/B49 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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: Andre Przywara --- drivers/edac/highbank_mc_edac.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/edac/highbank_mc_edac.c b/drivers/edac/highbank_mc_edac.c index a0c04a7f95e9..1c5b888ab11d 100644 --- a/drivers/edac/highbank_mc_edac.c +++ b/drivers/edac/highbank_mc_edac.c @@ -251,18 +251,17 @@ static int highbank_mc_probe(struct platform_device *pdev) return res; } -static int highbank_mc_remove(struct platform_device *pdev) +static void highbank_mc_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); - return 0; } static struct platform_driver highbank_mc_edac_driver = { .probe = highbank_mc_probe, - .remove = highbank_mc_remove, + .remove_new = highbank_mc_remove, .driver = { .name = "hb_mc_edac", .of_match_table = hb_ddr_ctrl_of_match, From patchwork Wed Oct 4 13:12: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: 13408758 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 01984E7B611 for ; Wed, 4 Oct 2023 13:13:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242569AbjJDNNY (ORCPT ); Wed, 4 Oct 2023 09:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242551AbjJDNNX (ORCPT ); Wed, 4 Oct 2023 09:13:23 -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 06EBAC6 for ; Wed, 4 Oct 2023 06:13:20 -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 1qo1gc-00072V-DT; Wed, 04 Oct 2023 15:13:10 +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 1qo1gb-00B2hd-RC; Wed, 04 Oct 2023 15:13:09 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gb-008zCk-Hb; Wed, 04 Oct 2023 15:13:09 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Johannes Thumshirn , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 10/21] EDAC/mpc85xx: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:43 +0200 Message-Id: <20231004131254.2673842-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2997; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lzciHbAe3ZS7W7FRMv6H90prLSo29pk0PdXKqElwutc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSn4xAn8Yb/H6SJI6rx+InIriiAFGkzAmANU NrnSYVdPLGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kpwAKCRCPgPtYfRL+ TimZCACkb81iY+CnT2Xijp0/y+VMG+Kyi2Jw8Uf8G9CXDo6hLV87kcPjSxMAXFw3JnvlGOYTx3z QOgCyf5vgjyYzBPDF+A/1W7X2rirBb3TFtPkBMVjIFZoprCAFnRvRzIXzm709y+TO8+34CHOMzj uLv7YBcZcaW23Yl+TcvsrLkZGMtHMj1DKKHeB+5xnmB8dccInnR1T3G18mAWK/EwLZXbH+2g/km TUnrTD+YdEt5lyh8EP3ullW15LZGfj4HUGAbQqHHeKC/q0r3qlBL3LFoJekOJM5U8i8gMgZ6hh9 EtH3qNWmtFEaw0XyTXYNGJf0MTKC1ydmuLzz5AjO8HVaFw8m 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/mpc85xx_edac.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index 2b5703e5066e..e0d702cef66f 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c @@ -300,7 +300,7 @@ static int mpc85xx_pci_err_probe(struct platform_device *op) return res; } -static int mpc85xx_pci_err_remove(struct platform_device *op) +static void mpc85xx_pci_err_remove(struct platform_device *op) { struct edac_pci_ctl_info *pci = dev_get_drvdata(&op->dev); struct mpc85xx_pci_pdata *pdata = pci->pvt_info; @@ -312,8 +312,6 @@ static int mpc85xx_pci_err_remove(struct platform_device *op) edac_pci_del_device(&op->dev); edac_pci_free_ctl_info(pci); - - return 0; } static const struct platform_device_id mpc85xx_pci_err_match[] = { @@ -325,7 +323,7 @@ static const struct platform_device_id mpc85xx_pci_err_match[] = { static struct platform_driver mpc85xx_pci_err_driver = { .probe = mpc85xx_pci_err_probe, - .remove = mpc85xx_pci_err_remove, + .remove_new = mpc85xx_pci_err_remove, .id_table = mpc85xx_pci_err_match, .driver = { .name = "mpc85xx_pci_err", @@ -591,7 +589,7 @@ static int mpc85xx_l2_err_probe(struct platform_device *op) return res; } -static int mpc85xx_l2_err_remove(struct platform_device *op) +static void mpc85xx_l2_err_remove(struct platform_device *op) { struct edac_device_ctl_info *edac_dev = dev_get_drvdata(&op->dev); struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; @@ -606,7 +604,6 @@ static int mpc85xx_l2_err_remove(struct platform_device *op) out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDIS, orig_l2_err_disable); edac_device_del_device(&op->dev); edac_device_free_ctl_info(edac_dev); - return 0; } static const struct of_device_id mpc85xx_l2_err_of_match[] = { @@ -630,7 +627,7 @@ MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match); static struct platform_driver mpc85xx_l2_err_driver = { .probe = mpc85xx_l2_err_probe, - .remove = mpc85xx_l2_err_remove, + .remove_new = mpc85xx_l2_err_remove, .driver = { .name = "mpc85xx_l2_err", .of_match_table = mpc85xx_l2_err_of_match, From patchwork Wed Oct 4 13:12: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: 13408772 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 99750E7B61A for ; Wed, 4 Oct 2023 13:13:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242576AbjJDNNb (ORCPT ); Wed, 4 Oct 2023 09:13:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242435AbjJDNNb (ORCPT ); Wed, 4 Oct 2023 09:13:31 -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 EC7B3A9 for ; Wed, 4 Oct 2023 06:13:27 -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 1qo1gc-000752-RQ; Wed, 04 Oct 2023 15:13:10 +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 1qo1gc-00B2hg-DD; Wed, 04 Oct 2023 15:13:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gc-008zCo-3P; Wed, 04 Oct 2023 15:13:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Marvin Lin , Stanley Chu , James Morse , Mauro Carvalho Chehab , Robert Richter , openbmc@lists.ozlabs.org, linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/21] EDAC/npcm: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:44 +0200 Message-Id: <20231004131254.2673842-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1923; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=9elwnacy4hC51ienj2Z+Us36weEmvKfpBXTgQQ+HOVA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSoRSWmM+3hSszD29TcULhrXY9FdJYJ6VvqT 9fuIDTZMdeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kqAAKCRCPgPtYfRL+ TnWHB/9mCD0nPuvxj1FdGxP1d161RTZjGuin2+lSXOh0ky5nwM0cbu0UPdlq6hWl/CIHXnbLhgE QMcUeiyA/ERmTe3O8AQgNmtMpCQGa+U6a2mtrHv3Y6+rsMV0E5vikf+EK44zTPWKa6L8OqUcQCG mhhhzfQ5NjWY5Ry9OdrbmRIOmNPi+xedSWOiuNrT8Un7d/ilQgU7hqHvSQ2ConDzSdf2U8HzKd0 cNs7uqpIF6LYJSM93kZXE2s+Um7Ku4v43Lk4BKenPlUd3KcT4CQs0fZGzFWAE6goC4MBip0Gios 6mXWpdWwMTiamaNfOkPS91hVkNV9YIsIIfBgL3kUafA/iKwn 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/npcm_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/npcm_edac.c b/drivers/edac/npcm_edac.c index 6d15c1550263..2e2133b784e9 100644 --- a/drivers/edac/npcm_edac.c +++ b/drivers/edac/npcm_edac.c @@ -410,7 +410,7 @@ static int edac_probe(struct platform_device *pdev) return rc; } -static int edac_remove(struct platform_device *pdev) +static void edac_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); struct priv_data *priv = mci->pvt_info; @@ -426,8 +426,6 @@ static int edac_remove(struct platform_device *pdev) regmap_write(npcm_regmap, pdata->ctl_int_mask_master, pdata->int_mask_master_global_mask); regmap_update_bits(npcm_regmap, pdata->ctl_ecc_en, pdata->ecc_en_mask, 0); - - return 0; } static const struct npcm_platform_data npcm750_edac = { @@ -533,7 +531,7 @@ static struct platform_driver npcm_edac_driver = { .of_match_table = npcm_edac_of_match, }, .probe = edac_probe, - .remove = edac_remove, + .remove_new = edac_remove, }; module_platform_driver(npcm_edac_driver); From patchwork Wed Oct 4 13:12: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: 13408764 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 71E79E7B61A for ; Wed, 4 Oct 2023 13:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242555AbjJDNN0 (ORCPT ); Wed, 4 Oct 2023 09:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242567AbjJDNNY (ORCPT ); Wed, 4 Oct 2023 09:13:24 -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 3695EBD for ; Wed, 4 Oct 2023 06:13:21 -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 1qo1gd-00075S-04; Wed, 04 Oct 2023 15:13:11 +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 1qo1gc-00B2hk-JU; Wed, 04 Oct 2023 15:13:10 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gc-008zCr-9Y; Wed, 04 Oct 2023 15:13:10 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Ralf Baechle , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, linux-mips@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/21] EDAC/octeon-l2c: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:45 +0200 Message-Id: <20231004131254.2673842-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-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=/oxSfhZRyaW18TQk8AIKutuEaVuwdk8d9mYnUs1gLFI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSpCV0ixeHYKds16TQH/glMuzn/dwynFhU04 IVra+HghyaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kqQAKCRCPgPtYfRL+ Tvg2B/wM9EEVqqcjv5qPwWrDsi1/lLqy0bCAsesTlv2R3+QSPcEko0jz/9+a+KCDW1ZRYIiRIOS IF+0eDYMZctHK37HdKyy4iuK/66JXmcafa4kuGZfLWEVemEodEEv2EDqZao8rkJVNXHkogx4ERJ bKN+x/TvjxSpOjUfEMMzIVMU49KKYrR3PEEwz9B4z3jB2XGdbnuQT85SES9GsJirld0Es3l+wOS d7UBFW5RJwupdaincp1cDiqdzQDeDf9mWQaouyz0PyPCufjUo59/z4nF2KH1Q6sthhrSfNLDZrJ tsgRX1/9CDsYiKPDHqxBPOI5wGiYg32RogI1LLM75Vao0nyb 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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: Philippe Mathieu-Daudé --- drivers/edac/octeon_edac-l2c.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/octeon_edac-l2c.c b/drivers/edac/octeon_edac-l2c.c index c33059e9b0be..4015eb9af6fe 100644 --- a/drivers/edac/octeon_edac-l2c.c +++ b/drivers/edac/octeon_edac-l2c.c @@ -184,19 +184,17 @@ static int octeon_l2c_probe(struct platform_device *pdev) return -ENXIO; } -static int octeon_l2c_remove(struct platform_device *pdev) +static void octeon_l2c_remove(struct platform_device *pdev) { struct edac_device_ctl_info *l2c = platform_get_drvdata(pdev); edac_device_del_device(&pdev->dev); edac_device_free_ctl_info(l2c); - - return 0; } static struct platform_driver octeon_l2c_driver = { .probe = octeon_l2c_probe, - .remove = octeon_l2c_remove, + .remove_new = octeon_l2c_remove, .driver = { .name = "octeon_l2c_edac", } From patchwork Wed Oct 4 13:12: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: 13408767 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 3304DE7B616 for ; Wed, 4 Oct 2023 13:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242578AbjJDNN3 (ORCPT ); Wed, 4 Oct 2023 09:13:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242570AbjJDNN2 (ORCPT ); Wed, 4 Oct 2023 09:13:28 -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 27E22C6 for ; Wed, 4 Oct 2023 06:13:24 -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 1qo1gf-0007CZ-Rq; Wed, 04 Oct 2023 15:13:13 +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 1qo1gf-00B2hp-9F; Wed, 04 Oct 2023 15:13:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1ge-008zD1-W1; Wed, 04 Oct 2023 15:13:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Ralf Baechle , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, linux-mips@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 13/21] EDAC/octeon-lmc: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:46 +0200 Message-Id: <20231004131254.2673842-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1657; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VeH3XaksoEh1y2Oj3rkICncn86zOLkB5zFze1tmESPk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWSvxPO2vz9A6QU+yKqgFQ5yVN/u5UXi/jyj5 CEmmNiN3a2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1krwAKCRCPgPtYfRL+ TtLOB/9fuzft1PSRbElBHB+Jt4dgjNmXw1wuaQ3tjFCqEEmg4Tgae2jIcIHaRwX/AVao7IaDfOH EbRhf32sUDpBLzcyklO2pyrJx5APW0iuE1ZpUBlMy/7QHde4X4Z71uH4cwJI6VTTNTyo1X1QST6 R4200uCPoUtBVupPlYpT3LVKutqBY6eCLGGoaRDXyg2onKXiyysYL3muT12Z7spnKDhtOOaUVtE 73gF7fQQUc46f0pPd4IOoNeCrLxVtgFcqDZY7xQXJA9Xz9CmO/PtbW9d8v7UI3W/SK/TDLXQsCc rnn2IsQyO1gCmVoO+PdIreUtDtAY7QBRenkUIVGXlX/N05jY 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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: Philippe Mathieu-Daudé --- drivers/edac/octeon_edac-lmc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/edac/octeon_edac-lmc.c b/drivers/edac/octeon_edac-lmc.c index aeb222ca3ed1..18615cbcd9ea 100644 --- a/drivers/edac/octeon_edac-lmc.c +++ b/drivers/edac/octeon_edac-lmc.c @@ -302,18 +302,17 @@ static int octeon_lmc_edac_probe(struct platform_device *pdev) return 0; } -static int octeon_lmc_edac_remove(struct platform_device *pdev) +static void octeon_lmc_edac_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); - return 0; } static struct platform_driver octeon_lmc_edac_driver = { .probe = octeon_lmc_edac_probe, - .remove = octeon_lmc_edac_remove, + .remove_new = octeon_lmc_edac_remove, .driver = { .name = "octeon_lmc_edac", } From patchwork Wed Oct 4 13:12: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: 13408768 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 D4358E7B617 for ; Wed, 4 Oct 2023 13:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242571AbjJDNN3 (ORCPT ); Wed, 4 Oct 2023 09:13:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242565AbjJDNN2 (ORCPT ); Wed, 4 Oct 2023 09:13:28 -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 6A441C9 for ; Wed, 4 Oct 2023 06:13:24 -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 1qo1gf-0007Cc-W8; Wed, 04 Oct 2023 15:13:14 +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 1qo1gf-00B2hs-JH; Wed, 04 Oct 2023 15:13:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gf-008zD4-9n; Wed, 04 Oct 2023 15:13:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Ralf Baechle , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, linux-mips@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/21] EDAC/octeon-pc: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:47 +0200 Message-Id: <20231004131254.2673842-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1725; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Kv+oSDldLimsQ+obk3163v8KjC/6IlZzGOXY4OqLu1c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWS2YgBHlU2fxMuYOXKv4Y3zI1LlwWvwS8VBB MyF2/GGhaCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1ktgAKCRCPgPtYfRL+ TjHOB/sHXJbG6Z1fO7fKTadgyHISwyepIHW7uYtX/j/4hdO7mb4hoKCcbPoeAtDZYzcensQK9Eh /86CV103QpIK483XNVQGlwVxI81hrORTKGck0H040RAlMhsWaAqv08eQd5/5gEo7TTNPU3j24dC eGgxdn948+Hv4zM4B8S+K+rSiTCFy3qf2S3HaDIJpbRpTSvOOAvqV/LvsmqWsSzAMGj9oUUcKZn gXFU/ALtaBocT4BSvHhLHNwmOskGJqLv6J/+oKc5coBymG1sTSKZ+H7mhnp2qZko5YRNlZP+pob xp1nR4I82+GHpdwGzHxJIOV6WJRWr2YhIpDu9KU9TD0raqqj 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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: Philippe Mathieu-Daudé --- drivers/edac/octeon_edac-pc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/edac/octeon_edac-pc.c b/drivers/edac/octeon_edac-pc.c index 754eced59c32..ea8a8e337b1e 100644 --- a/drivers/edac/octeon_edac-pc.c +++ b/drivers/edac/octeon_edac-pc.c @@ -119,19 +119,18 @@ static int co_cache_error_probe(struct platform_device *pdev) return -ENXIO; } -static int co_cache_error_remove(struct platform_device *pdev) +static void co_cache_error_remove(struct platform_device *pdev) { struct co_cache_error *p = platform_get_drvdata(pdev); unregister_co_cache_error_notifier(&p->notifier); edac_device_del_device(&pdev->dev); edac_device_free_ctl_info(p->ed); - return 0; } static struct platform_driver co_cache_error_driver = { .probe = co_cache_error_probe, - .remove = co_cache_error_remove, + .remove_new = co_cache_error_remove, .driver = { .name = "octeon_pc_edac", } From patchwork Wed Oct 4 13:12: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: 13408770 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 74656E7B611 for ; Wed, 4 Oct 2023 13:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242567AbjJDNN3 (ORCPT ); Wed, 4 Oct 2023 09:13:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242571AbjJDNN2 (ORCPT ); Wed, 4 Oct 2023 09:13:28 -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 6DAF3D8 for ; Wed, 4 Oct 2023 06:13:24 -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 1qo1gh-0007Gf-Aa; Wed, 04 Oct 2023 15:13:15 +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 1qo1gg-00B2hx-N3; Wed, 04 Oct 2023 15:13:14 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gg-008zDA-Dd; Wed, 04 Oct 2023 15:13:14 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Ralf Baechle , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, linux-mips@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/21] EDAC/octeon-pci: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:48 +0200 Message-Id: <20231004131254.2673842-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1646; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1BIoxdcCkNn8aBKc7g1RC+WXhnEnRyVoBd8VvWO/5aI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWS38KNQRlNoL2wu/6z9pWgbQo8TmuJ+0U1Qj sRurqIM44iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1ktwAKCRCPgPtYfRL+ Tnb7B/wLwtZAYdplABoZ6UV34g07FlPTcxWuVfAcKkdWDQEaEV0HaTUf5z7mCSGXhfdNwqeiPkF MWuaj1Wq0iygq7xr/5/Iax6p8g9nX+ZYJdmBxzUxKAAdodHG0hgVG9p/Gx9j30wxAiehFdSUw+S 9SkKaIda3glxyMSgXeKMgYf/+YkpF/ylv0Ca01yDUkv3RBrqUuuuq2PBJuGiIWeLxd9fKWmt5Jm I/RpGrL/Qo3cUzCkpF2lIV/9hyukXQV73feEXcgqWNiv6qRTOpxuryfAAFOECc5UWK2nvcu3N1K dyVVXW7lyJML3G2z/9j/MpzIQU/DEdWRtd37AbFdVPrZdbNh 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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: Philippe Mathieu-Daudé --- drivers/edac/octeon_edac-pci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/octeon_edac-pci.c b/drivers/edac/octeon_edac-pci.c index 28b238eecefc..108ad9493cfb 100644 --- a/drivers/edac/octeon_edac-pci.c +++ b/drivers/edac/octeon_edac-pci.c @@ -87,19 +87,17 @@ static int octeon_pci_probe(struct platform_device *pdev) return res; } -static int octeon_pci_remove(struct platform_device *pdev) +static void octeon_pci_remove(struct platform_device *pdev) { struct edac_pci_ctl_info *pci = platform_get_drvdata(pdev); edac_pci_del_device(&pdev->dev); edac_pci_free_ctl_info(pci); - - return 0; } static struct platform_driver octeon_pci_driver = { .probe = octeon_pci_probe, - .remove = octeon_pci_remove, + .remove_new = octeon_pci_remove, .driver = { .name = "octeon_pci_edac", } From patchwork Wed Oct 4 13:12: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: 13408769 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 37887E7B619 for ; Wed, 4 Oct 2023 13:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242565AbjJDNN3 (ORCPT ); Wed, 4 Oct 2023 09:13:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232819AbjJDNN2 (ORCPT ); Wed, 4 Oct 2023 09:13:28 -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 E9234DD for ; Wed, 4 Oct 2023 06:13:24 -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 1qo1gj-0007QF-UE; Wed, 04 Oct 2023 15:13:17 +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 1qo1gj-00B2i1-Bx; Wed, 04 Oct 2023 15:13:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gj-008zDE-2S; Wed, 04 Oct 2023 15:13:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 16/21] EDAC/ppc4xx: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:49 +0200 Message-Id: <20231004131254.2673842-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1860; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7+K7V4ko+U58e0DBSK68jv/Fh+kpvJt5AHEDnEQkN/8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWS9he3+XRHXCdhspvtmVKDvJI2XFXG3yCVT7 gEStxJCdFaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kvQAKCRCPgPtYfRL+ TrDWCACTYiBv5ClFdbPJsqjFncsEthxDxnoL1y2R5xirdcoyucSK+JII3gW+ImcdZO/wDugcMZn 9Vmp4kWIVw/41NGQy3Vn5+fjKPyd6CS/axVGBC6l6t6F2aDbkdgL+oufseNQgQ8irPmuExWPSaY 8d3YVvBtOh5DAY6yiUHoi0GqTk+hjqGbJTu1ZfOJvmx9bK0em6Pudu85vs8tAqikaVHymzuRhqC laiqG1KFCt1edGih1Qf2bQX++fD/+vfagdyPEUXYq8Dm5mfhzG0aLmNFAzjYMG97eQFltc/dMMw Z+u6sDTZrV6N8oTMZOxRwSrK8349QUsD6rk/ECLEiLmXHFQk 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/ppc4xx_edac.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c index 046969b4e82e..1eea3341a916 100644 --- a/drivers/edac/ppc4xx_edac.c +++ b/drivers/edac/ppc4xx_edac.c @@ -1329,8 +1329,7 @@ static int ppc4xx_edac_probe(struct platform_device *op) * * Unconditionally returns 0. */ -static int -ppc4xx_edac_remove(struct platform_device *op) +static void ppc4xx_edac_remove(struct platform_device *op) { struct mem_ctl_info *mci = dev_get_drvdata(&op->dev); struct ppc4xx_edac_pdata *pdata = mci->pvt_info; @@ -1344,8 +1343,6 @@ ppc4xx_edac_remove(struct platform_device *op) edac_mc_del_mc(mci->pdev); edac_mc_free(mci); - - return 0; } /** @@ -1379,7 +1376,7 @@ ppc4xx_edac_opstate_init(void) static struct platform_driver ppc4xx_edac_driver = { .probe = ppc4xx_edac_probe, - .remove = ppc4xx_edac_remove, + .remove_new = ppc4xx_edac_remove, .driver = { .name = PPC4XX_EDAC_MODULE_NAME, .of_match_table = ppc4xx_edac_match, From patchwork Wed Oct 4 13:12: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: 13408776 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 175C4E7B615 for ; Wed, 4 Oct 2023 13:13:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242583AbjJDNNh (ORCPT ); Wed, 4 Oct 2023 09:13:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242435AbjJDNNg (ORCPT ); Wed, 4 Oct 2023 09:13:36 -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 5783BA9 for ; Wed, 4 Oct 2023 06:13:32 -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 1qo1gk-0007QL-6G; Wed, 04 Oct 2023 15:13:18 +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 1qo1gj-00B2i4-K2; Wed, 04 Oct 2023 15:13:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gj-008zDM-AP; Wed, 04 Oct 2023 15:13:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Manivannan Sadhasivam , Andy Gross , Bjorn Andersson , Konrad Dybcio , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-arm-msm@vger.kernel.org, linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/21] EDAC/qcom: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:50 +0200 Message-Id: <20231004131254.2673842-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1816; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ZdUYs8E4yW1qYtOFseUEWaVj1C6IqHPDURRLLjD5VEM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWTDX30yQTmnzTVc0atLlvnhRS5wCNqI5VLIh Phs/vMLUyKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kwwAKCRCPgPtYfRL+ To9CCACYSSjTOy5bkEF3+1kytG7zdjaSFU8aPcDigJxBlEC3wKwDP8JksIDurQ2Y6D56+HbSpSm aImlaWRxOTBg/DR3TDHx+DIX8eSu6U1Y+sxibQzOVWddvcjK+I9NJ8579x+DFhfJyisVDrjgi+s u9dY/KCdmBu5GkxAQENX8ybdnxYHvQWpANWrueqtnqT1yQmVXNrRRYPAsZIbKHtKJWEb9rdzsOM QTsMmdu/vkNRI+asPPfkdZFIEAcuOh+g7NiyU/1TPAZgNPdCaIkbaD8HC6EYd6FHVH/YT1TRpwk j9YlTDFB6j+Z0ukGq5l4vqmJjzypTxkT4UzfvX1lU7M6omyW 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/qcom_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c index b2db545c6810..5539917c01dd 100644 --- a/drivers/edac/qcom_edac.c +++ b/drivers/edac/qcom_edac.c @@ -390,14 +390,12 @@ static int qcom_llcc_edac_probe(struct platform_device *pdev) return rc; } -static int qcom_llcc_edac_remove(struct platform_device *pdev) +static void qcom_llcc_edac_remove(struct platform_device *pdev) { struct edac_device_ctl_info *edev_ctl = dev_get_drvdata(&pdev->dev); edac_device_del_device(edev_ctl->dev); edac_device_free_ctl_info(edev_ctl); - - return 0; } static const struct platform_device_id qcom_llcc_edac_id_table[] = { @@ -408,7 +406,7 @@ MODULE_DEVICE_TABLE(platform, qcom_llcc_edac_id_table); static struct platform_driver qcom_llcc_edac_driver = { .probe = qcom_llcc_edac_probe, - .remove = qcom_llcc_edac_remove, + .remove_new = qcom_llcc_edac_remove, .driver = { .name = "qcom_llcc_edac", }, From patchwork Wed Oct 4 13:12: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: 13408775 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 5EA01E7B616 for ; Wed, 4 Oct 2023 13:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242579AbjJDNNd (ORCPT ); Wed, 4 Oct 2023 09:13:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242435AbjJDNNc (ORCPT ); Wed, 4 Oct 2023 09:13:32 -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 A419398 for ; Wed, 4 Oct 2023 06:13:29 -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 1qo1gk-0007Sj-Se; Wed, 04 Oct 2023 15:13:18 +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 1qo1gk-00B2i9-EL; Wed, 04 Oct 2023 15:13:18 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gk-008zDR-4b; Wed, 04 Oct 2023 15:13:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Michal Simek , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 18/21] EDAC/synopsys: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:51 +0200 Message-Id: <20231004131254.2673842-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1849; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=CJrOzZ4Epmcu9ncmtBzFKO841eFe5RbToqeeSvPnONA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWTJBXkK6dxGqC8eBMIDUkYYEEe2CxcW0Au28 m8prJMZoSKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kyQAKCRCPgPtYfRL+ Ts+SCACHe2VLH3zElk+lbr6yAKmtuhLd+60Ahb/M3YC4G+codJZlOVIatZaL4Z3+Ihz1f+arJg0 +/OSYlhrXMfEk1SLOXFGrIetNTM0W1jl9ekXKasPqll7TF/nCvAcl65+WzmPRU50HrXaOAVimYe /jEl5ku9Nf7JaVJHEbVzzrlnVLVTXLv5sxYPmfXXJ6dd81SEqmwa8XBKUrk+h+zmaFkQyYU0T68 kJpkZZxDY121T/7J5fSy6GciS9+v23+K+5oWB9t5liOjE86QLXgwdRmnEIgTMo7P6CG4E1GTdzN 48n25zZqTEl6Qzi3WlKjUxPzW2CiywznT/iDnbWT5l8KOJSs 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/synopsys_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index c4fc64cbecd0..709babce43ba 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -1410,7 +1410,7 @@ static int mc_probe(struct platform_device *pdev) * * Return: Unconditionally 0 */ -static int mc_remove(struct platform_device *pdev) +static void mc_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); struct synps_edac_priv *priv = mci->pvt_info; @@ -1425,8 +1425,6 @@ static int mc_remove(struct platform_device *pdev) edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); - - return 0; } static struct platform_driver synps_edac_mc_driver = { @@ -1435,7 +1433,7 @@ static struct platform_driver synps_edac_mc_driver = { .of_match_table = synps_edac_match, }, .probe = mc_probe, - .remove = mc_remove, + .remove_new = mc_remove, }; module_platform_driver(synps_edac_mc_driver); From patchwork Wed Oct 4 13:12: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: 13408774 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 4E6D1E7B60F for ; Wed, 4 Oct 2023 13:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242580AbjJDNNc (ORCPT ); Wed, 4 Oct 2023 09:13:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242573AbjJDNNb (ORCPT ); Wed, 4 Oct 2023 09:13:31 -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 BAA9ABD for ; Wed, 4 Oct 2023 06:13:28 -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 1qo1gl-0007TU-Hj; Wed, 04 Oct 2023 15:13:19 +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 1qo1gk-00B2iC-Va; Wed, 04 Oct 2023 15:13:18 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gk-008zDV-M1; Wed, 04 Oct 2023 15:13:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Tero Kristo , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 19/21] EDAC/ti: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:52 +0200 Message-Id: <20231004131254.2673842-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1601; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=q5rXU2mPNVI4wA00lScfFSSYu8XeTfkri0g8tkt1Rc8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWTLyks/pI1WJFUh5fwn/LySzAeHltcbFJbZv MBjWsadJUWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kywAKCRCPgPtYfRL+ TsvvCACk8eS6ZoDP3MGbFdz/noD0gy+KKYsCCxToqljjqNr+9YbWRlaMDytwKVSHKcjFi6ul9Oi IyhoKYJrkJZpGCOzaBrmvlrWAr9CXri5nB6HCi8U21ldOpax8nUgAMaIJrwTNPUt8WqT31dSwXy 0LnCanwjrhQpFaByxeunZEXDERjnKfbmhfFNOd8Cj0r2F2tPt5578N86YLCy5qQgOu/it6knDgm pbGY1K7gOdbeRNy8QhK9C5KWymsBByVQZxEDaexx9aNHlP63Jfqrga3ta394W5a4Nk3wG1N59lB C1l//Xr0M3saDKTZ07ZiYuIJmgYxCaQYS71ekzyBdQwMoL6D 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/ti_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/ti_edac.c b/drivers/edac/ti_edac.c index 6971ded598de..29723c9592f7 100644 --- a/drivers/edac/ti_edac.c +++ b/drivers/edac/ti_edac.c @@ -312,19 +312,17 @@ static int ti_edac_probe(struct platform_device *pdev) return ret; } -static int ti_edac_remove(struct platform_device *pdev) +static void ti_edac_remove(struct platform_device *pdev) { struct mem_ctl_info *mci = platform_get_drvdata(pdev); edac_mc_del_mc(&pdev->dev); edac_mc_free(mci); - - return 0; } static struct platform_driver ti_edac_driver = { .probe = ti_edac_probe, - .remove = ti_edac_remove, + .remove_new = ti_edac_remove, .driver = { .name = EDAC_MOD_NAME, .of_match_table = ti_edac_of_match, From patchwork Wed Oct 4 13:12: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: 13408773 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 B2C64E7B61C for ; Wed, 4 Oct 2023 13:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242573AbjJDNNc (ORCPT ); Wed, 4 Oct 2023 09:13:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242435AbjJDNNb (ORCPT ); Wed, 4 Oct 2023 09:13:31 -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 9472CB0 for ; Wed, 4 Oct 2023 06:13:28 -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 1qo1gl-0007Ur-LD; Wed, 04 Oct 2023 15:13:19 +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 1qo1gl-00B2iG-6l; Wed, 04 Oct 2023 15:13:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gk-008zDY-Ta; Wed, 04 Oct 2023 15:13:18 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Khuong Dinh , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/21] EDAC/xgene: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:53 +0200 Message-Id: <20231004131254.2673842-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1925; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6VEGQt7C6nJUehXuKqKsFEkvNxw1D1brTAvSnS6IeSY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWTMvxqvMPRk8PU35tVshztQHIPItHXwBGDE9 sWZSExXTcuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1kzAAKCRCPgPtYfRL+ Tlo3CACW6KqDgd9vZ39JqIrNPrqulGeZfc87PGykmbeR6rlxyhRX2icIvx6NReU46ZMd0jRBy7T Zy8G0PMquekoP/rR6nwzAkMv1sZ58d4icvu2t+syb2GPytnWxQUhEqBQzwN20ZQ9ICO9UcR0mvJ sLGeidUYBeVe0ShvSkpIiYyceRxai+6wLoeMUGBaCK6OtbhhVsorIM+QGOjGv2yE0HFE75QZknA bIbqA8Aasc75mXiL/8/pZVuzB8f77tbBXVhV7BVLdb6K403gZ5yCKrudRNJq9VUy1Vd32cVwpuL bh91+h7j6HLDYwnfHUv/vg0igijvHiR3N5MYqEA7XGEQwEWV 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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/edac/xgene_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c index c52b9dd9154c..1b50f8160013 100644 --- a/drivers/edac/xgene_edac.c +++ b/drivers/edac/xgene_edac.c @@ -1960,7 +1960,7 @@ static int xgene_edac_probe(struct platform_device *pdev) return rc; } -static int xgene_edac_remove(struct platform_device *pdev) +static void xgene_edac_remove(struct platform_device *pdev) { struct xgene_edac *edac = dev_get_drvdata(&pdev->dev); struct xgene_edac_mc_ctx *mcu; @@ -1981,8 +1981,6 @@ static int xgene_edac_remove(struct platform_device *pdev) list_for_each_entry_safe(node, temp_node, &edac->socs, next) xgene_edac_soc_remove(node); - - return 0; } static const struct of_device_id xgene_edac_of_match[] = { @@ -1993,7 +1991,7 @@ MODULE_DEVICE_TABLE(of, xgene_edac_of_match); static struct platform_driver xgene_edac_driver = { .probe = xgene_edac_probe, - .remove = xgene_edac_remove, + .remove_new = xgene_edac_remove, .driver = { .name = "xgene-edac", .of_match_table = xgene_edac_of_match, From patchwork Wed Oct 4 13:12: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: 13408777 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 8F897E7B611 for ; Wed, 4 Oct 2023 13:13:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233096AbjJDNNj (ORCPT ); Wed, 4 Oct 2023 09:13:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242584AbjJDNNi (ORCPT ); Wed, 4 Oct 2023 09:13:38 -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 F3619D9 for ; Wed, 4 Oct 2023 06:13:33 -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 1qo1gm-0007W3-G4; Wed, 04 Oct 2023 15:13:20 +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 1qo1gl-00B2iL-Qk; Wed, 04 Oct 2023 15:13:19 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qo1gl-008zDc-HP; Wed, 04 Oct 2023 15:13:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: Shubhrajyoti Datta , Sai Krishna Potthuri , James Morse , Mauro Carvalho Chehab , Robert Richter , Michal Simek , linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 21/21] EDAC/zynqmp: Convert to platform remove callback returning void Date: Wed, 4 Oct 2023 15:12:54 +0200 Message-Id: <20231004131254.2673842-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1865; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=XCQfjQ8VouZfr8MiUFp8q3/YTDxh/atvIhopZVzSTp8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlHWTSkjeFLkxVUEadUtq/txnaVH9wcGeB6Agy4 3V1ek85hqSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZR1k0gAKCRCPgPtYfRL+ TqWMB/9UzqB4fvybjGXXWTeYBXy5B0xJ+lIjcYcZMELF/T+4VeFqF86ILUczkFPQXH+trrjuACP 8HuOhVL+wQVemPtz5ch2zbAI2kQyr+GbIibAktAIAGtMv6/gpBb3EkDqRnygAZ9QgVLmKboHgw1 AmkWXW4ANt8IFH5ccf5F2O5XORNoD3VnflkdCQBLnCPuRw6faOHOBmAzAYxNPlcnLeNPEkGBcK5 bPs7VveY0dXTcs+DRqSahwfS3QmqfFGq0ooMbh/gnTSqtcfVnG4L88f69TOQzPeWdkP8gUJyRxS IlYGz8EIESQw1zT7mdRA4vuvaF5+5qCmbRP+HW0l+lZ2axFk 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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: Michal Simek --- drivers/edac/zynqmp_edac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/edac/zynqmp_edac.c b/drivers/edac/zynqmp_edac.c index ac7d1e0b324c..2d9a5cfd8931 100644 --- a/drivers/edac/zynqmp_edac.c +++ b/drivers/edac/zynqmp_edac.c @@ -426,7 +426,7 @@ static int edac_probe(struct platform_device *pdev) return ret; } -static int edac_remove(struct platform_device *pdev) +static void edac_remove(struct platform_device *pdev) { struct edac_device_ctl_info *dci = platform_get_drvdata(pdev); struct edac_priv *priv = dci->pvt_info; @@ -440,8 +440,6 @@ static int edac_remove(struct platform_device *pdev) edac_device_del_device(&pdev->dev); edac_device_free_ctl_info(dci); - - return 0; } static const struct of_device_id zynqmp_ocm_edac_match[] = { @@ -457,7 +455,7 @@ static struct platform_driver zynqmp_ocm_edac_driver = { .of_match_table = zynqmp_ocm_edac_match, }, .probe = edac_probe, - .remove = edac_remove, + .remove_new = edac_remove, }; module_platform_driver(zynqmp_ocm_edac_driver); From patchwork Fri Oct 13 10:04: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: 13420606 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 78DDDCDB47E for ; Fri, 13 Oct 2023 10:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjJMKFI (ORCPT ); Fri, 13 Oct 2023 06:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbjJMKFH (ORCPT ); Fri, 13 Oct 2023 06:05: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 7FC5EA9 for ; Fri, 13 Oct 2023 03:05:05 -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 1qrF1w-0000nW-0M; Fri, 13 Oct 2023 12:04:28 +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 1qrF1v-001Mgr-0X; Fri, 13 Oct 2023 12:04:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qrF1u-00FUQJ-NH; Fri, 13 Oct 2023 12:04:26 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Borislav Petkov , Tony Luck Cc: York Sun , James Morse , Mauro Carvalho Chehab , Robert Richter , Johannes Thumshirn , linux-edac@vger.kernel.org Subject: [PATCH 22/21] EDAC/fsl_ddr: Convert to platform remove callback returning void Date: Fri, 13 Oct 2023 12:04:23 +0200 Message-ID: <20231013100422.1382040-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> References: <20231004131254.2673842-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3167; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=x2jlLq6LTLkrDyKaAuEkuwwmOdIX/lfOC/9NfAOJ0yc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlKRYnx9BbuKmQzTOTJiCP5Wo8F0UJOrewvTDlX SxyEzHnpFKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSkWJwAKCRCPgPtYfRL+ TvrMB/4wpfX1iMkdNeMuC072bDt7XUixD8B6oSk5XYPGcJ9NV/z3SSmO2/TVmnhxj6OwGlp3Tvx 7pGSL0oMDOHeC3NpMn1muaPTX78/zvdUdhmxGqGnjsnxomYu7qfj+nAmss2H1GjJwrL1Y7Y6YS2 CQWN/0pCzDyXB9BpZbs6WZpucINUXhz+lfQU9H0er0cahJjK7R9WJByRyObGkczO4t9nSHQliz+ 5Dpr21TGSYctQqWK3TqQarQreH7mJHVh08W/0SDADzSm4kdkZtTZC64TLNoCsZlaxKQaqjuuh3v 8/AqdFXJMe+L6jCoaHhIjLEKUh4M/59aismS/qQQ/B2ir7Dr 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-edac@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@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(). fsl_mc_err_remove() is used as callback in two drivers. So these have to be converted together to the void returning remove callback. Signed-off-by: Uwe Kleine-König --- Hello, I found another two drivers to convert that my coccinelle recipe missed. Best regards Uwe drivers/edac/fsl_ddr_edac.c | 3 +-- drivers/edac/fsl_ddr_edac.h | 2 +- drivers/edac/layerscape_edac.c | 2 +- drivers/edac/mpc85xx_edac.c | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c index b81757555a8a..d148d262d0d4 100644 --- a/drivers/edac/fsl_ddr_edac.c +++ b/drivers/edac/fsl_ddr_edac.c @@ -612,7 +612,7 @@ int fsl_mc_err_probe(struct platform_device *op) return res; } -int fsl_mc_err_remove(struct platform_device *op) +void fsl_mc_err_remove(struct platform_device *op) { struct mem_ctl_info *mci = dev_get_drvdata(&op->dev); struct fsl_mc_pdata *pdata = mci->pvt_info; @@ -629,5 +629,4 @@ int fsl_mc_err_remove(struct platform_device *op) edac_mc_del_mc(&op->dev); edac_mc_free(mci); - return 0; } diff --git a/drivers/edac/fsl_ddr_edac.h b/drivers/edac/fsl_ddr_edac.h index 332439d7b2d9..c0994a2a003c 100644 --- a/drivers/edac/fsl_ddr_edac.h +++ b/drivers/edac/fsl_ddr_edac.h @@ -72,5 +72,5 @@ struct fsl_mc_pdata { int irq; }; int fsl_mc_err_probe(struct platform_device *op); -int fsl_mc_err_remove(struct platform_device *op); +void fsl_mc_err_remove(struct platform_device *op); #endif diff --git a/drivers/edac/layerscape_edac.c b/drivers/edac/layerscape_edac.c index 7c5e2b3c0daa..d2f895033280 100644 --- a/drivers/edac/layerscape_edac.c +++ b/drivers/edac/layerscape_edac.c @@ -27,7 +27,7 @@ MODULE_DEVICE_TABLE(of, fsl_ddr_mc_err_of_match); static struct platform_driver fsl_ddr_mc_err_driver = { .probe = fsl_mc_err_probe, - .remove = fsl_mc_err_remove, + .remove_new = fsl_mc_err_remove, .driver = { .name = "fsl_ddr_mc_err", .of_match_table = fsl_ddr_mc_err_of_match, diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index e0d702cef66f..c1bc53f4e184 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c @@ -656,7 +656,7 @@ MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match); static struct platform_driver mpc85xx_mc_err_driver = { .probe = fsl_mc_err_probe, - .remove = fsl_mc_err_remove, + .remove_new = fsl_mc_err_remove, .driver = { .name = "mpc85xx_mc_err", .of_match_table = mpc85xx_mc_err_of_match,