From patchwork Fri Oct 20 07:55:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 736429 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 1E5CEC07480 for ; Fri, 20 Oct 2023 07:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376511AbjJTH5Z (ORCPT ); Fri, 20 Oct 2023 03:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376490AbjJTH47 (ORCPT ); Fri, 20 Oct 2023 03:56:59 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E84210C7 for ; Fri, 20 Oct 2023 00:56:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkMz-0003Fm-50; Fri, 20 Oct 2023 09:56:33 +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 1qtkMx-002yUB-KE; Fri, 20 Oct 2023 09:56:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMx-002OIG-Ah; Fri, 20 Oct 2023 09:56:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Corentin Labbe , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Jonathan Corbet , Rob Herring , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 03/42] crypto: sun8i-ss - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:25 +0200 Message-ID: <20231020075521.2121571-47-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1986; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dt3UmLOLBBO2sbhm3wcuiJQjtHH5IgnIOJQ3j1q0V20=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJtGu9EmhrcZ5waKFOIBGm5rNeS0MeowvAWl tQ7nDdLSv+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIybQAKCRCPgPtYfRL+ TogfB/9Kb+cay62DHxbG3K3kjHEidibrgd0CyjH0qk/8cHfHjZkKB53DJMDBKppljtKXEtU5jgP wqWL5n5C9C7wfSt+4P7uoHI//pWbYiHJbhqASPMGq+JmpPlj4MU5rjoNL85lHg3x8oIRsOsRsem tzHZMUMB6v2SBUDv0nekadLOLxdBSRfsniLbfFbY0NSAqShGH2N6sF7917Zb9hguy1HeAvqIOij hNgJneYtnFmnuVfDz7iMYGWLcNo6drvJp7vFztfqoB0V+8jr8HA6dj4aAhBL67C5StACIniMibH IpyvuSTeSdZPCduj6YweaeJx1G6cJdk+/+BR7CmcgneZdHHe 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c index 4a9587285c04..f14c60359d19 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c @@ -908,7 +908,7 @@ static int sun8i_ss_probe(struct platform_device *pdev) return err; } -static int sun8i_ss_remove(struct platform_device *pdev) +static void sun8i_ss_remove(struct platform_device *pdev) { struct sun8i_ss_dev *ss = platform_get_drvdata(pdev); @@ -921,8 +921,6 @@ static int sun8i_ss_remove(struct platform_device *pdev) sun8i_ss_free_flows(ss, MAXFLOW - 1); sun8i_ss_pm_exit(ss); - - return 0; } static const struct of_device_id sun8i_ss_crypto_of_match_table[] = { @@ -936,7 +934,7 @@ MODULE_DEVICE_TABLE(of, sun8i_ss_crypto_of_match_table); static struct platform_driver sun8i_ss_driver = { .probe = sun8i_ss_probe, - .remove = sun8i_ss_remove, + .remove_new = sun8i_ss_remove, .driver = { .name = "sun8i-ss", .pm = &sun8i_ss_pm_ops, From patchwork Fri Oct 20 07:55:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 736444 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 D58D8CDB474 for ; Fri, 20 Oct 2023 07:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376462AbjJTH4k (ORCPT ); Fri, 20 Oct 2023 03:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376474AbjJTH4j (ORCPT ); Fri, 20 Oct 2023 03:56:39 -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 336E3D5D for ; Fri, 20 Oct 2023 00:56:36 -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 1qtkMy-0003G2-E3; Fri, 20 Oct 2023 09:56:32 +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 1qtkMy-002yUH-0m; Fri, 20 Oct 2023 09:56:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMx-002OIN-NT; Fri, 20 Oct 2023 09:56:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Corentin Labbe , linux-crypto@vger.kernel.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 05/42] crypto: amlogic-gxl-core - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:27 +0200 Message-ID: <20231020075521.2121571-49-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1994; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hXDLzoMA+y5An9CnasWFkoxWoOYFEvCz++Cfy0XuFYo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJvvN0Q7PlqJK6xoRBrUxyKtBnx/kra+bF0y 8Nd+QigtyKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIybwAKCRCPgPtYfRL+ ThQvB/9o/uBuSUqapZmm9Aei5FfC51JaCF1TbLTRTnkO6/NKxrj7pB47dHjpvhmlrNROqxLA++b iJM4e/jqun7RAwFIocihBaMNdl4PodtEAX/WRN74KskqYsboHZJFC6uKKsc55BOesAJluYyxpL7 F46lHV9GT+8VKwmgbx+jt9qCRsmNs5UYsjyPTsZ2jmw7tvrKVr6Bu1gpOqrxTFqHJPKHiFvnfuu jV+zWdEpxJaYtBJwaX4g0v8XTUW2iLnA5nCMdS3hqiG9QyCpU8mopgqiRW4efBYh0XwUTNFkXL8 +IlI6+pLxpMKB1AaQU6b1Y5ENcS13cyg86yELKIr/xUswT/Y 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/amlogic/amlogic-gxl-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c index da6dfe0f9ac3..f54ab0d0b1e8 100644 --- a/drivers/crypto/amlogic/amlogic-gxl-core.c +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c @@ -299,7 +299,7 @@ static int meson_crypto_probe(struct platform_device *pdev) return err; } -static int meson_crypto_remove(struct platform_device *pdev) +static void meson_crypto_remove(struct platform_device *pdev) { struct meson_dev *mc = platform_get_drvdata(pdev); @@ -312,7 +312,6 @@ static int meson_crypto_remove(struct platform_device *pdev) meson_free_chanlist(mc, MAXFLOW - 1); clk_disable_unprepare(mc->busclk); - return 0; } static const struct of_device_id meson_crypto_of_match_table[] = { @@ -323,7 +322,7 @@ MODULE_DEVICE_TABLE(of, meson_crypto_of_match_table); static struct platform_driver meson_crypto_driver = { .probe = meson_crypto_probe, - .remove = meson_crypto_remove, + .remove_new = meson_crypto_remove, .driver = { .name = "gxl-crypto", .of_match_table = meson_crypto_of_match_table, From patchwork Fri Oct 20 07:55:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 736425 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 40B95C001DF for ; Fri, 20 Oct 2023 07:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376537AbjJTH5x (ORCPT ); Fri, 20 Oct 2023 03:57:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376535AbjJTH5O (ORCPT ); Fri, 20 Oct 2023 03:57:14 -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 1551B10D8 for ; Fri, 20 Oct 2023 00:56:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN1-0003GA-QE; Fri, 20 Oct 2023 09:56:35 +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 1qtkMy-002yUK-8R; Fri, 20 Oct 2023 09:56:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMx-002OIS-V6; Fri, 20 Oct 2023 09:56:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Neal Liu , Joel Stanley , Andrew Jeffery , linux-aspeed@lists.ozlabs.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 06/42] crypto: aspeed-acry - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:28 +0200 Message-ID: <20231020075521.2121571-50-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1920; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=54Ov1wDXU3uWdC2nv6ZV9WOkI/eETqggVxDYU5WHQUI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJwuPF2/dtX0EWI11lNIxKHUdyZpTjmxblJa OoyE3K9YGuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIycAAKCRCPgPtYfRL+ TjFXB/9s890zmNZddoqEknLAT6f8vBqFGRsKwmrh8nmgWbqnCPGyjgBSCQXmGlBcjCpXpffTGIB G6nzkPrlnNgJrDyfIkwvE9/f+o3UDW+6ZG24Hb3R6EMx/VB/hqd01NIHL62KOB+HIWIMPa8p7gA xcsvni3f0bUqL0julx0F3hYyX1UNBT8n4usY8wrC/TCL7tzwVmIO0mnkvIvwGTvn0N3FySsu2wZ HSg2Zy4X4kMmuhpSh3Yxw2W9wR9SaG3z8hMgG1FOrydkC4FZ34TNKBL3U34qrpRUn8TvjCIecYb aWZ5/CBuh521VBdzssPXGoI9nox8jac2KYnnyL3E9fo7o9or 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/aspeed/aspeed-acry.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/aspeed/aspeed-acry.c b/drivers/crypto/aspeed/aspeed-acry.c index 247c568aa8df..b4613bd4ad96 100644 --- a/drivers/crypto/aspeed/aspeed-acry.c +++ b/drivers/crypto/aspeed/aspeed-acry.c @@ -794,7 +794,7 @@ static int aspeed_acry_probe(struct platform_device *pdev) return rc; } -static int aspeed_acry_remove(struct platform_device *pdev) +static void aspeed_acry_remove(struct platform_device *pdev) { struct aspeed_acry_dev *acry_dev = platform_get_drvdata(pdev); @@ -802,15 +802,13 @@ static int aspeed_acry_remove(struct platform_device *pdev) crypto_engine_exit(acry_dev->crypt_engine_rsa); tasklet_kill(&acry_dev->done_task); clk_disable_unprepare(acry_dev->clk); - - return 0; } MODULE_DEVICE_TABLE(of, aspeed_acry_of_matches); static struct platform_driver aspeed_acry_driver = { .probe = aspeed_acry_probe, - .remove = aspeed_acry_remove, + .remove_new = aspeed_acry_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = aspeed_acry_of_matches, From patchwork Fri Oct 20 07:55:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 736424 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 E1F71C07480 for ; Fri, 20 Oct 2023 07:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376533AbjJTH5y (ORCPT ); Fri, 20 Oct 2023 03:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376536AbjJTH5P (ORCPT ); Fri, 20 Oct 2023 03:57:15 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 767EE10D9 for ; Fri, 20 Oct 2023 00:56:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN1-0003GE-QF; Fri, 20 Oct 2023 09:56:35 +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 1qtkMy-002yUN-Gw; Fri, 20 Oct 2023 09:56:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMy-002OIb-7Y; Fri, 20 Oct 2023 09:56:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Neal Liu , Joel Stanley , Andrew Jeffery , linux-aspeed@lists.ozlabs.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 07/42] crypto: aspeed-hace - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:29 +0200 Message-ID: <20231020075521.2121571-51-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1955; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0YO0s5LXreauqMFpfEjyAZpLsQgNKr0gbAnyprV3vAo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJy3jnWIJF75wjEniVJf9lztk78hAUfW7ZhN wOsZS/iKt2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIycgAKCRCPgPtYfRL+ Ttg/CACG4iqbhG0quRs93JEgKLuQwHqCW3hwSPjBvbphXpp5VtHjN27w/YXL5Np2WoPUPNrVgmw hWLzG5LoZss8FnMu+acBo3Oii3QiqUEkSKilvJntZ0/QawkFoila0LMskRLAuP4yR7IdWqwBm4Y oILFwfy3jJOBMv6pHH4aF0H+4DBYRFYehXHwDtL9Z9bHNqn80SCQKYYhNYpH/FS8zqTrMfeIrPz KEQAkkcx7HcdAsnMF7LRMeoHVp2gEoxl0cD4T1+7J+mu6+yuIVgBC0KzFPtUBqqxNIUlWvovSwe HkQCQbp21lnyB0DNzw5OSg5BQ1vlwbBDeVRzsbUABsSTx5Bj 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/aspeed/aspeed-hace.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c index d9da04fb816e..062f2a66dd23 100644 --- a/drivers/crypto/aspeed/aspeed-hace.c +++ b/drivers/crypto/aspeed/aspeed-hace.c @@ -245,7 +245,7 @@ static int aspeed_hace_probe(struct platform_device *pdev) return rc; } -static int aspeed_hace_remove(struct platform_device *pdev) +static void aspeed_hace_remove(struct platform_device *pdev) { struct aspeed_hace_dev *hace_dev = platform_get_drvdata(pdev); struct aspeed_engine_crypto *crypto_engine = &hace_dev->crypto_engine; @@ -260,15 +260,13 @@ static int aspeed_hace_remove(struct platform_device *pdev) tasklet_kill(&crypto_engine->done_task); clk_disable_unprepare(hace_dev->clk); - - return 0; } MODULE_DEVICE_TABLE(of, aspeed_hace_of_matches); static struct platform_driver aspeed_hace_driver = { .probe = aspeed_hace_probe, - .remove = aspeed_hace_remove, + .remove_new = aspeed_hace_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = aspeed_hace_of_matches, From patchwork Fri Oct 20 07:55:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 736443 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 830B6CDB47E for ; Fri, 20 Oct 2023 07:56:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376430AbjJTH4m (ORCPT ); Fri, 20 Oct 2023 03:56:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376463AbjJTH4k (ORCPT ); Fri, 20 Oct 2023 03:56:40 -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 8749ED6A for ; Fri, 20 Oct 2023 00:56:38 -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 1qtkMz-0003GY-FW; Fri, 20 Oct 2023 09:56:33 +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 1qtkMy-002yUU-VP; Fri, 20 Oct 2023 09:56:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMy-002OIj-M8; Fri, 20 Oct 2023 09:56:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 09/42] crypto: atmel-sha - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:31 +0200 Message-ID: <20231020075521.2121571-53-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1734; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6MBLziPLHGBBHG0dQCc2YnPs3iaW4/zbYDK+2XY2HOc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ0pozRpzAhctUodhZ/liuxn3c/9yjaw35fQ KLE8zdA8J+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIydAAKCRCPgPtYfRL+ ThqGB/9fCGeUiA8jOad9Blb0WwuQ6sxTGkhzhgrevaTCxXiGiaModMEgwsQJXwpBRMTyLPAzB3y /+hiCRSK5WG18uMnlvB9GopWRg88haDhOa7k0tFi0L9VyEieUSoWv+Ej4YQe1dpwSgv33h/kTNt B8SdOQl3OQtIOhNkQKR3X+A3JIM9r77Wrwxl/UUqhfqW3/E9MNINxNWazRpM8fBWO6Kgi6pK7Cz CTW/UwAaz0LFvYkh/aekIqOHakVr/hs6VQehiUwumnm0rZa1/upzTZ47634Rcxbdda3+55PT3Bg jNn+YIurFg7IULa/RmXqkJNUHDjOxa/2ylUBc2fY+KX1/PI4 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/atmel-sha.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 3622120add62..ad45af288ece 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -2680,7 +2680,7 @@ static int atmel_sha_probe(struct platform_device *pdev) return err; } -static int atmel_sha_remove(struct platform_device *pdev) +static void atmel_sha_remove(struct platform_device *pdev) { struct atmel_sha_dev *sha_dd = platform_get_drvdata(pdev); @@ -2697,13 +2697,11 @@ static int atmel_sha_remove(struct platform_device *pdev) atmel_sha_dma_cleanup(sha_dd); clk_unprepare(sha_dd->iclk); - - return 0; } static struct platform_driver atmel_sha_driver = { .probe = atmel_sha_probe, - .remove = atmel_sha_remove, + .remove_new = atmel_sha_remove, .driver = { .name = "atmel_sha", .of_match_table = atmel_sha_dt_ids, From patchwork Fri Oct 20 07:55: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: 736439 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 53B5AC19F5C for ; Fri, 20 Oct 2023 07:56:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376473AbjJTH4u (ORCPT ); Fri, 20 Oct 2023 03:56:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376476AbjJTH4m (ORCPT ); Fri, 20 Oct 2023 03:56:42 -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 2108F114 for ; Fri, 20 Oct 2023 00:56:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN0-0003I6-4X; Fri, 20 Oct 2023 09:56:34 +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 1qtkMz-002yUh-Ii; Fri, 20 Oct 2023 09:56:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMz-002OIv-9V; Fri, 20 Oct 2023 09:56:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Arnd Bergmann , Rob Herring , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/42] crypto: bcm/cipher - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:34 +0200 Message-ID: <20231020075521.2121571-56-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1774; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=grsiWToFgT6aQoiICp8JLE2vEIHkNwFngoCYVPgmLpg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ3rwVHycQzpTPs6O7dSCJ74PKOpigSje2jE DW34UykAL2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIydwAKCRCPgPtYfRL+ TorZCACumE4O8oGA0K0qr8CjCoL6N5SVA2my3TmXdJZ63tzqaIW/B/zz9zIvUKJVQHjQ4E8qo73 0wZVXoAlj57im73vIdbBA7ueKQb2kdaSZKxBz8+FpXU9mEy5UFwZpfvGN6r+Pvl0pyKPL2xC7Al pw8f0YhiYmFSaPRoQR5yg7lMTtfQ6GpsNbUcyIguKeVKtdW2ebBcnhtlWzPIprsjRfP8D4r5OQu EcEmuw6KXov6NmBQIFtX1Izxr1sviDeAG5lkDnzzefXPTNh0T2askvf8hNwQgYMS79jXNA+0axJ ZN8z1MV/PfJXM5ZadLannYXlCGGDFV7RZzK/U4Zqp16Kc8eR 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/bcm/cipher.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index 689be70d69c1..10968ddb146b 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -4713,7 +4713,7 @@ static int bcm_spu_probe(struct platform_device *pdev) return err; } -static int bcm_spu_remove(struct platform_device *pdev) +static void bcm_spu_remove(struct platform_device *pdev) { int i; struct device *dev = &pdev->dev; @@ -4751,7 +4751,6 @@ static int bcm_spu_remove(struct platform_device *pdev) } spu_free_debugfs(); spu_mb_release(pdev); - return 0; } /* ===== Kernel Module API ===== */ @@ -4762,7 +4761,7 @@ static struct platform_driver bcm_spu_pdriver = { .of_match_table = of_match_ptr(bcm_spu_dt_ids), }, .probe = bcm_spu_probe, - .remove = bcm_spu_remove, + .remove_new = bcm_spu_remove, }; module_platform_driver(bcm_spu_pdriver); From patchwork Fri Oct 20 07:55: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: 736428 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 22E35C19F5C for ; Fri, 20 Oct 2023 07:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376525AbjJTH52 (ORCPT ); Fri, 20 Oct 2023 03:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376522AbjJTH5D (ORCPT ); Fri, 20 Oct 2023 03:57:03 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30ECE10CB for ; Fri, 20 Oct 2023 00:56:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN0-0003Iu-Iy; Fri, 20 Oct 2023 09:56:34 +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 1qtkMz-002yUq-WF; Fri, 20 Oct 2023 09:56:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMz-002OJ3-ND; Fri, 20 Oct 2023 09:56:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Tom Lendacky , John Allen , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/42] crypto: ccp/sp - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:36 +0200 Message-ID: <20231020075521.2121571-58-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1836; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ayTLlCQMdSbgn6KWLbeMyIN0n7ue0X/qH6AAgjCJYhw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ6lDm4n7DEbQO3+piwGfVbcBzo0wfVIOPux 5A+K6wYVD+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyegAKCRCPgPtYfRL+ Ti6bB/sEthwblxvCnI4YseV4DMqxpzm4x+F9pcQjlVtV6lsHjYoUtG0BWXRsoQVbCShaASO52SF Lb774dxmCCXd4akQGqXyTD6PjMBcEM9urEVUBvXl5+xm7DaQwbKplGbUkVvgKJP7oxf1/hdpw8P WmLfIkjxsT+pdJgpm7+xJy/VabUVl3Y2kY0EV+8Qu/ALKmMxP2HhDpWc5us8rUIT5l2eZgx/YW3 0FZVivNZYgsL9mOGXDCkz11qAGk+N3dgm/xkvo+FdK/A8MgP0wXEn6vHnzfpl8TR2sQqwxaIZ9E Y4cSdY0nExL7GZnqe3uj6+TlMnbHIU8xujA1JWYYXMWCWuPm 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/ccp/sp-platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccp/sp-platform.c b/drivers/crypto/ccp/sp-platform.c index 7d79a8744f9a..473301237760 100644 --- a/drivers/crypto/ccp/sp-platform.c +++ b/drivers/crypto/ccp/sp-platform.c @@ -180,7 +180,7 @@ static int sp_platform_probe(struct platform_device *pdev) return ret; } -static int sp_platform_remove(struct platform_device *pdev) +static void sp_platform_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct sp_device *sp = dev_get_drvdata(dev); @@ -188,8 +188,6 @@ static int sp_platform_remove(struct platform_device *pdev) sp_destroy(sp); dev_notice(dev, "disabled\n"); - - return 0; } #ifdef CONFIG_PM @@ -222,7 +220,7 @@ static struct platform_driver sp_platform_driver = { #endif }, .probe = sp_platform_probe, - .remove = sp_platform_remove, + .remove_new = sp_platform_remove, #ifdef CONFIG_PM .suspend = sp_platform_suspend, .resume = sp_platform_resume, From patchwork Fri Oct 20 07:55: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: 736442 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 B09ECCDB474 for ; Fri, 20 Oct 2023 07:56:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376474AbjJTH4o (ORCPT ); Fri, 20 Oct 2023 03:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376466AbjJTH4l (ORCPT ); Fri, 20 Oct 2023 03:56:41 -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 886A2D6C for ; Fri, 20 Oct 2023 00:56:38 -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 1qtkN0-0003JE-PO; Fri, 20 Oct 2023 09:56:34 +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 1qtkN0-002yUt-68; Fri, 20 Oct 2023 09:56:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMz-002OJ7-TP; Fri, 20 Oct 2023 09:56:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Gilad Ben-Yossef , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/42] crypto: ccree/cc - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:37 +0200 Message-ID: <20231020075521.2121571-59-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1782; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lejF1Bxw1Ws8DzMMotjuzFXNNQJMw121/Q+2EpVjQDA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ7c43IbLjB7MZVAgapLEjLoYXSb8lH1ygZ2 dmMW5485+aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyewAKCRCPgPtYfRL+ Th1fB/wP9wWwCDsZVZAMTEXbbeZcUaxJYrdczFR5AxprEOdCbCEDWymqEBWZ4uGJsWs6GnQgZCH 8pSFKr/6O7p93H+KimqGqNFqPs/vBxDSS0JFsb9tfgfgwkTWKuL9n+GUZS6QcCQgfaWAGoz2lYg TI5kxCh37weuY4PbpemdiJFg3NE2vKdTia2d45TBNdIaGDmT3GlPDqzKno66g5YhCdSN3GKoPRD 3PJ/67vSQQPiT+FXstIY1OGQTSV9oe561SavpSNKXyFC1DvVLJhxB2u2JlciBU5k6thFvX9toSn NxCYPqvSAYT/ElGx04VqVs3UvSOycdmON4cgJLj9Ins7u9fc 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/ccree/cc_driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c index 0f0694037dd7..9177b54bb0f5 100644 --- a/drivers/crypto/ccree/cc_driver.c +++ b/drivers/crypto/ccree/cc_driver.c @@ -623,7 +623,7 @@ static int ccree_probe(struct platform_device *plat_dev) return 0; } -static int ccree_remove(struct platform_device *plat_dev) +static void ccree_remove(struct platform_device *plat_dev) { struct device *dev = &plat_dev->dev; @@ -632,8 +632,6 @@ static int ccree_remove(struct platform_device *plat_dev) cleanup_cc_resources(plat_dev); dev_info(dev, "ARM ccree device terminated\n"); - - return 0; } static struct platform_driver ccree_driver = { @@ -645,7 +643,7 @@ static struct platform_driver ccree_driver = { #endif }, .probe = ccree_probe, - .remove = ccree_remove, + .remove_new = ccree_remove, }; static int __init ccree_init(void) From patchwork Fri Oct 20 07:55: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: 736441 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 10D1CCDB47E for ; Fri, 20 Oct 2023 07:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376465AbjJTH4r (ORCPT ); Fri, 20 Oct 2023 03:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376471AbjJTH4l (ORCPT ); Fri, 20 Oct 2023 03:56:41 -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 192A4106 for ; Fri, 20 Oct 2023 00:56:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN1-0003Je-2V; Fri, 20 Oct 2023 09:56:35 +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 1qtkN0-002yV1-LW; Fri, 20 Oct 2023 09:56:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN0-002OJF-C7; Fri, 20 Oct 2023 09:56:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Hans Ulli Kroll , Linus Walleij , Corentin Labbe , linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/42] crypto: gemini/sl3516-ce - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:39 +0200 Message-ID: <20231020075521.2121571-61-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1961; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cXvwJBMSSvZhSYD9MgdQ+cRHZ7jrelKO3QFjEobXMJo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ9nvUOgoLCk56fdwyR2BZYS0yfJPIGl4Cn1 tYTGUJzl0uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyfQAKCRCPgPtYfRL+ ToJACACmuQL+2F6OmzmzLgErfAu4Op4CwkMav8JTjBmlcMytcbXNWIEqLmiIWnotYuWJdg0n957 CReZ6D1nqu+DiLxFANS/1CN4cFn+6Ay3lToX67aYnWpMFvAubQMHkPS/oXgrC8/9TFWt0oEgX/c FRm2neaPsPwMeMIyj864BZIK6TfXenWQOH9HOB18ZjjSBCtPmN2w3lEDj3xi8dLoUvm7RSMYpiU Qygi7oTXu0nvIVlgwXSXRPh//D+ylX4+UJV4vgmlwnf942nxNx6N9zreWWAoHMjR+5YiGzfS3xw zsqFS0WzlWV/hDd5K+GmrTODrpMvg82mi838pUItUzgPpTZW 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/gemini/sl3516-ce-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/gemini/sl3516-ce-core.c b/drivers/crypto/gemini/sl3516-ce-core.c index 0f43c6e39bb9..1d1a889599bb 100644 --- a/drivers/crypto/gemini/sl3516-ce-core.c +++ b/drivers/crypto/gemini/sl3516-ce-core.c @@ -505,7 +505,7 @@ static int sl3516_ce_probe(struct platform_device *pdev) return err; } -static int sl3516_ce_remove(struct platform_device *pdev) +static void sl3516_ce_remove(struct platform_device *pdev) { struct sl3516_ce_dev *ce = platform_get_drvdata(pdev); @@ -518,8 +518,6 @@ static int sl3516_ce_remove(struct platform_device *pdev) #ifdef CONFIG_CRYPTO_DEV_SL3516_DEBUG debugfs_remove_recursive(ce->dbgfs_dir); #endif - - return 0; } static const struct of_device_id sl3516_ce_crypto_of_match_table[] = { @@ -530,7 +528,7 @@ MODULE_DEVICE_TABLE(of, sl3516_ce_crypto_of_match_table); static struct platform_driver sl3516_ce_driver = { .probe = sl3516_ce_probe, - .remove = sl3516_ce_remove, + .remove_new = sl3516_ce_remove, .driver = { .name = "sl3516-crypto", .pm = &sl3516_ce_pm_ops, From patchwork Fri Oct 20 07:55: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: 736435 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 5CF56CDB474 for ; Fri, 20 Oct 2023 07:57:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376516AbjJTH5A (ORCPT ); Fri, 20 Oct 2023 03:57:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376491AbjJTH4p (ORCPT ); Fri, 20 Oct 2023 03:56:45 -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 A17A1D55 for ; Fri, 20 Oct 2023 00:56:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN4-0003KU-F2; Fri, 20 Oct 2023 09:56:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN0-002yV6-SB; Fri, 20 Oct 2023 09:56:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN0-002OJJ-JD; Fri, 20 Oct 2023 09:56:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Ruan Jinjie , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 18/42] crypto: hisilicon/sec - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:40 +0200 Message-ID: <20231020075521.2121571-62-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1850; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tZ6e+IH+dxUAavTJYzBY4f+9q0LmXpIohCn9zbxKlLA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ+tJhUUEclQTllz+1kqMKs5wsx2si2oL4X9 APxQIvNf9uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyfgAKCRCPgPtYfRL+ Tj4mB/9mWXyd4094WuJ9k5smC3HvVlumKMITHmG8QVnOtjNZ/3yVaD932jKvk38fVFPuoKKk3xW snCLtXCeMzdazbi0nPvj37SfIwO2EUV5fP3Ybdv9pkODgEVS00Ce39Y6Riace5JAfGsoaPE5+tx qqMBbWbG01oYtdncVul8+W2ubdwqtlVzwC3BUCfpmvq1q/S79LK0SXxoMV6T1LLPUERB0zzj01U sLIkNg9wrjzNTyspwjpmzs6mvmh88m5irh1jCJQlzkQ4UggV6PvEilaDJaYUjH3LWHY9EV//w/k n67y+U+GJbcz8WFjQld3zf46ztHow4uefNGUChryPfnTs7es 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/hisilicon/sec/sec_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/hisilicon/sec/sec_drv.c b/drivers/crypto/hisilicon/sec/sec_drv.c index e1e08993de12..afdddf87cc34 100644 --- a/drivers/crypto/hisilicon/sec/sec_drv.c +++ b/drivers/crypto/hisilicon/sec/sec_drv.c @@ -1271,7 +1271,7 @@ static int sec_probe(struct platform_device *pdev) return ret; } -static int sec_remove(struct platform_device *pdev) +static void sec_remove(struct platform_device *pdev) { struct sec_dev_info *info = platform_get_drvdata(pdev); int i; @@ -1287,8 +1287,6 @@ static int sec_remove(struct platform_device *pdev) } sec_base_exit(info); - - return 0; } static const __maybe_unused struct of_device_id sec_match[] = { @@ -1306,7 +1304,7 @@ MODULE_DEVICE_TABLE(acpi, sec_acpi_match); static struct platform_driver sec_driver = { .probe = sec_probe, - .remove = sec_remove, + .remove_new = sec_remove, .driver = { .name = "hisi_sec_platform_driver", .of_match_table = sec_match, From patchwork Fri Oct 20 07:55: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: 736440 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 A1E9AC07480 for ; Fri, 20 Oct 2023 07:56:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376464AbjJTH4s (ORCPT ); Fri, 20 Oct 2023 03:56:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376473AbjJTH4m (ORCPT ); Fri, 20 Oct 2023 03:56:42 -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 8668FD55 for ; Fri, 20 Oct 2023 00:56:38 -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 1qtkN1-0003LG-LY; Fri, 20 Oct 2023 09:56:35 +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 1qtkN1-002yVE-8y; Fri, 20 Oct 2023 09:56:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN0-002OJR-WC; Fri, 20 Oct 2023 09:56:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/42] crypto: img-hash - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:42 +0200 Message-ID: <20231020075521.2121571-64-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=XOlhP2cUnDue0y/xguD/NrllsbeYPsRQcuUgKsHTF74=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjo4bbZ/kuG/P97Iuxnnx7jZffq2lrtxzPjp3MrBsTn 9sqlNLYyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsCNdmb/7/U7+5mR1kkR/oyL 4YV6W75Kzg3/vkzO6aXS4ft7Th3j3nDSf/mOaDO9m//PTL23dX1rn9EL+70pAUZzVvez1zn+uq/ cref09PevNM4t0SvT/HVyas4dN1x+zqHx1DXJ7G9109bHF0f3ZT+5c+CxlPTO8IfS+8NeZXrETt 1X8EmEOzE2qah6S9SrGm+hwx8LG5d57PKOb9eOb/mxxtS83XG6zaccnW5tnqzT3i6HL845oh4S8 i8pVy9ceXpWwuLyHeIK37wDNxWuqDjNpyN4aebK3Nd50f7bHMW2eTBpqcfrFcXtvt2xP4/PXnRW 3CFNUUMD5sVnxGcI8y3ImmIyb9bsa81edrwts+ssp94FAA== 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/img-hash.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index 45063693859c..d269036bdaa3 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/crypto/img-hash.c @@ -1043,7 +1043,7 @@ static int img_hash_probe(struct platform_device *pdev) return err; } -static int img_hash_remove(struct platform_device *pdev) +static void img_hash_remove(struct platform_device *pdev) { struct img_hash_dev *hdev; @@ -1061,8 +1061,6 @@ static int img_hash_remove(struct platform_device *pdev) clk_disable_unprepare(hdev->hash_clk); clk_disable_unprepare(hdev->sys_clk); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1101,7 +1099,7 @@ static const struct dev_pm_ops img_hash_pm_ops = { static struct platform_driver img_hash_driver = { .probe = img_hash_probe, - .remove = img_hash_remove, + .remove_new = img_hash_remove, .driver = { .name = "img-hash-accelerator", .pm = &img_hash_pm_ops, From patchwork Fri Oct 20 07:55: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: 736438 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 045A1C004C0 for ; Fri, 20 Oct 2023 07:56:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376479AbjJTH4x (ORCPT ); Fri, 20 Oct 2023 03:56:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376463AbjJTH4n (ORCPT ); Fri, 20 Oct 2023 03:56:43 -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 5C307D46 for ; Fri, 20 Oct 2023 00:56:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN2-0003Me-O1; Fri, 20 Oct 2023 09:56:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN1-002yVR-U7; Fri, 20 Oct 2023 09:56:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN1-002OJd-L7; Fri, 20 Oct 2023 09:56:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Daniele Alessandrelli , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/42] crypto: intel/keembay-ocs-aes - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:45 +0200 Message-ID: <20231020075521.2121571-67-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2028; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6Iqa0rT+nQv07AkoPvD1/LNP6FLbiuHF+uJ0vL3pqrM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKEwgNJv+b+gyUgYmyCO58K6fuZtPxcrr/eV gLbWRsB2r2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyhAAKCRCPgPtYfRL+ TsgGB/4smlNe2YNChQBHw42o9dXv3pZ47o9PYPPRXx4XDStqjqBt9g8VrFmIaiD9xG11MLirr/e s2jRCVE8Uy2K5TA0YxW6hRq7YQvVb+o/lNmkEkStIIteXX959EqAdvlZcCWor8CNPrZ5BSBGVu4 021sfwf/ilKEJNrnbZi5/YLtZupzNdOa95lRHRRQXURsc4AxGuiQZd1BSpftqy8QGxY1vF45pjK qlWa8V7tq5RLFS7moxL9lCAZtSIz81dT0r1UX97HJ/dL4ahOwUymhiL8xoctDZWyfuxAI6BZhjE 8vbCVnwgf0+BoI9rCRE8nrzDbadpNN5TCrYxv20bDOXLESrI 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/intel/keembay/keembay-ocs-aes-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/intel/keembay/keembay-ocs-aes-core.c b/drivers/crypto/intel/keembay/keembay-ocs-aes-core.c index 1e2fd9a754ec..9b2d098e5eb2 100644 --- a/drivers/crypto/intel/keembay/keembay-ocs-aes-core.c +++ b/drivers/crypto/intel/keembay/keembay-ocs-aes-core.c @@ -1562,7 +1562,7 @@ static const struct of_device_id kmb_ocs_aes_of_match[] = { {} }; -static int kmb_ocs_aes_remove(struct platform_device *pdev) +static void kmb_ocs_aes_remove(struct platform_device *pdev) { struct ocs_aes_dev *aes_dev; @@ -1575,8 +1575,6 @@ static int kmb_ocs_aes_remove(struct platform_device *pdev) spin_unlock(&ocs_aes.lock); crypto_engine_exit(aes_dev->engine); - - return 0; } static int kmb_ocs_aes_probe(struct platform_device *pdev) @@ -1658,7 +1656,7 @@ static int kmb_ocs_aes_probe(struct platform_device *pdev) /* The OCS driver is a platform device. */ static struct platform_driver kmb_ocs_aes_driver = { .probe = kmb_ocs_aes_probe, - .remove = kmb_ocs_aes_remove, + .remove_new = kmb_ocs_aes_remove, .driver = { .name = DRV_NAME, .of_match_table = kmb_ocs_aes_of_match, From patchwork Fri Oct 20 07:55: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: 736426 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 D78B3C07480 for ; Fri, 20 Oct 2023 07:57:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376518AbjJTH5b (ORCPT ); Fri, 20 Oct 2023 03:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376517AbjJTH5A (ORCPT ); Fri, 20 Oct 2023 03:57:00 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE1610C9 for ; Fri, 20 Oct 2023 00:56:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN2-0003N1-PL; Fri, 20 Oct 2023 09:56:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN2-002yVY-CL; Fri, 20 Oct 2023 09:56:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN2-002OJl-3N; Fri, 20 Oct 2023 09:56:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Daniele Alessandrelli , Declan Murphy , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/42] crypto: intel/keembay-ocs-hcu - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:47 +0200 Message-ID: <20231020075521.2121571-69-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2078; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=AtYRt9Lgbk2X8ie83TNT0+RrJhu72yEL46Pi6Bon1Gk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKG1TpZh51pkvN52fSb+bnVcCtm2Ll7MgvTK S2shPXXA72JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyhgAKCRCPgPtYfRL+ TvUfB/43IsQ4yCezOIUofXy78bcHjR2igQAcvtoHBD3Obw6YIlQia6bt2SkEjMwLif6/oIajPxi d/l6zbJovLTVocvPuzYWbeGYIVZRJg/OE6bcnoA3TCc9OV8lYfXnl0kpORzRaRmbDRI5wKFCiFl 0Ve9C5seKsFFPKb7CLw34LYqM/8bKztY/VM25zSCj1suZmk24OCySDFlmdHF883kb67TbA0IOSD svcIjqV7ZfPPBlYl84PgJ38IOr3hrvchd5WweyjkpDaTsm+nl1ZrqdijnbIbm79OscVNjiPytdJ CI9ex/i0hVozzJK7vkZ9PaPL9p3C5wrSdlQHW/12mM4w6o9e 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/intel/keembay/keembay-ocs-hcu-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c b/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c index 8a39f959bb53..c2dfca73fe4e 100644 --- a/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c +++ b/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c @@ -1151,7 +1151,7 @@ static const struct of_device_id kmb_ocs_hcu_of_match[] = { {} }; -static int kmb_ocs_hcu_remove(struct platform_device *pdev) +static void kmb_ocs_hcu_remove(struct platform_device *pdev) { struct ocs_hcu_dev *hcu_dev = platform_get_drvdata(pdev); @@ -1162,8 +1162,6 @@ static int kmb_ocs_hcu_remove(struct platform_device *pdev) spin_lock_bh(&ocs_hcu.lock); list_del(&hcu_dev->list); spin_unlock_bh(&ocs_hcu.lock); - - return 0; } static int kmb_ocs_hcu_probe(struct platform_device *pdev) @@ -1244,7 +1242,7 @@ static int kmb_ocs_hcu_probe(struct platform_device *pdev) /* The OCS driver is a platform device. */ static struct platform_driver kmb_ocs_hcu_driver = { .probe = kmb_ocs_hcu_probe, - .remove = kmb_ocs_hcu_remove, + .remove_new = kmb_ocs_hcu_remove, .driver = { .name = DRV_NAME, .of_match_table = kmb_ocs_hcu_of_match, From patchwork Fri Oct 20 07:55: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: 736433 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 377E3CDB47E for ; Fri, 20 Oct 2023 07:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376574AbjJTH5R (ORCPT ); Fri, 20 Oct 2023 03:57:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376481AbjJTH44 (ORCPT ); Fri, 20 Oct 2023 03:56:56 -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 8FFCCD79 for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN3-0003Qd-Ku; Fri, 20 Oct 2023 09:56:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN2-002yVf-Ql; Fri, 20 Oct 2023 09:56:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN2-002OJt-HX; Fri, 20 Oct 2023 09:56:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 27/42] crypto: mxs-dcp - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:49 +0200 Message-ID: <20231020075521.2121571-71-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=euiLVQrUUXCOfCIx3yamKs26fh4H9DHuPQAvDF0cDww=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKIe9EuOxceKf3mTup3FOp9F3FwD/STwHdKC 1EDcX4AGOKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyiAAKCRCPgPtYfRL+ TmlzB/9gJk8y36NTUUzciGQPyj+/VCpLmi3nzzIl19e67hqbo90JYWcPtCzq9TxmCeAScyxK4kf LdsQBigCwEZVhsXa8vvsEIx2xLgPETYULvGjOPNgi8WzWhSZGtmLOo763fFy3FN3hkyhe/j+6WC TphMd7yrn005uCqT2FS37/C/KgGZZ/kBLCoUGoqoOBIWg772TQJvx+93CAGIPB4izPv48O4AzZv e3zoXQTxlRe3aIGF2131M2u4nSj+Sxe/UgwO1PwEilQHGU6vRPFmzJh4yJIKVwMz2w3A8D8Srkh ji/RmtKSVRs3kg9TMFtYb7PlbK7EFJlq9rzXLTkh2lSy5Tvj 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/mxs-dcp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c index f6b7bce0e656..d41efddbc772 100644 --- a/drivers/crypto/mxs-dcp.c +++ b/drivers/crypto/mxs-dcp.c @@ -1131,7 +1131,7 @@ static int mxs_dcp_probe(struct platform_device *pdev) return ret; } -static int mxs_dcp_remove(struct platform_device *pdev) +static void mxs_dcp_remove(struct platform_device *pdev) { struct dcp *sdcp = platform_get_drvdata(pdev); @@ -1150,8 +1150,6 @@ static int mxs_dcp_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); global_sdcp = NULL; - - return 0; } static const struct of_device_id mxs_dcp_dt_ids[] = { @@ -1164,7 +1162,7 @@ MODULE_DEVICE_TABLE(of, mxs_dcp_dt_ids); static struct platform_driver mxs_dcp_driver = { .probe = mxs_dcp_probe, - .remove = mxs_dcp_remove, + .remove_new = mxs_dcp_remove, .driver = { .name = "mxs-dcp", .of_match_table = mxs_dcp_dt_ids, From patchwork Fri Oct 20 07:55: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: 736437 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 5E94DCDB474 for ; Fri, 20 Oct 2023 07:56:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376463AbjJTH4y (ORCPT ); Fri, 20 Oct 2023 03:56:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376472AbjJTH4n (ORCPT ); Fri, 20 Oct 2023 03:56:43 -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 206E2D6A for ; Fri, 20 Oct 2023 00:56:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN4-0003SF-9o; Fri, 20 Oct 2023 09:56:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN3-002yVk-1k; Fri, 20 Oct 2023 09:56:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN2-002OJx-Ou; Fri, 20 Oct 2023 09:56:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/42] crypto: n2_core - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:50 +0200 Message-ID: <20231020075521.2121571-72-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2526; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=T4Bo9aTX+eT4XZxS9Uehb5DGE6qoa9vfLkG/lQm8P1E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKKp+r8wGWeqt4VxnCEQ9YZACBc7wPHtBPkm kRXZyTwAs6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyigAKCRCPgPtYfRL+ TvgbCACSH5chw0ZKkC5YttaWCAz0z59H0nBEzc3DIYKZIwiWniZ05ijUkV9nMcd/oFBbdHuvOCF W7xAhlFdBHu4d79xUI6UxPiYJeF7Qcz3bN80LxZ+w6n82xsPwDcnaBXyPpHzC9T9iS/uuASxH6M 0SH+/XHcXUkBB/GWC59LGZ+/0AL/O+AhX1sZKHeJm6X3Q9GGZAlhTnH8ygH4Je+Egyj+659E6QT iKctioi0qMeQ1C/F3TaWCZrfhid9U65wxW0seOoJVYy14TZJHgAIl3k/KwdpvaZrC7h90des3+e //lnphFKS/TTI8kS2hVD1vnmxFIym58Urigf1RcEvt4IEavY 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/n2_core.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c index d5a32d71a3e9..caea98622c33 100644 --- a/drivers/crypto/n2_core.c +++ b/drivers/crypto/n2_core.c @@ -2011,7 +2011,7 @@ static int n2_crypto_probe(struct platform_device *dev) return err; } -static int n2_crypto_remove(struct platform_device *dev) +static void n2_crypto_remove(struct platform_device *dev) { struct n2_crypto *np = dev_get_drvdata(&dev->dev); @@ -2022,8 +2022,6 @@ static int n2_crypto_remove(struct platform_device *dev) release_global_resources(); free_n2cp(np); - - return 0; } static struct n2_mau *alloc_ncp(void) @@ -2109,7 +2107,7 @@ static int n2_mau_probe(struct platform_device *dev) return err; } -static int n2_mau_remove(struct platform_device *dev) +static void n2_mau_remove(struct platform_device *dev) { struct n2_mau *mp = dev_get_drvdata(&dev->dev); @@ -2118,8 +2116,6 @@ static int n2_mau_remove(struct platform_device *dev) release_global_resources(); free_ncp(mp); - - return 0; } static const struct of_device_id n2_crypto_match[] = { @@ -2146,7 +2142,7 @@ static struct platform_driver n2_crypto_driver = { .of_match_table = n2_crypto_match, }, .probe = n2_crypto_probe, - .remove = n2_crypto_remove, + .remove_new = n2_crypto_remove, }; static const struct of_device_id n2_mau_match[] = { @@ -2173,7 +2169,7 @@ static struct platform_driver n2_mau_driver = { .of_match_table = n2_mau_match, }, .probe = n2_mau_probe, - .remove = n2_mau_remove, + .remove_new = n2_mau_remove, }; static struct platform_driver * const drivers[] = { From patchwork Fri Oct 20 07:55: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: 736436 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 49AE4C004C0 for ; Fri, 20 Oct 2023 07:56:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376492AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376489AbjJTH4p (ORCPT ); Fri, 20 Oct 2023 03:56:45 -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 91FFF115 for ; Fri, 20 Oct 2023 00:56:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN4-0003Wl-Jo; Fri, 20 Oct 2023 09:56:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN3-002yVr-GC; Fri, 20 Oct 2023 09:56:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN3-002OK5-7A; Fri, 20 Oct 2023 09:56:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 30/42] crypto: omap-des - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:52 +0200 Message-ID: <20231020075521.2121571-74-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1861; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7jd/KTl/DuQ/eWYNI6pmYZCSZAZtYSaW3wam/creYY0=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjox6ud9yeQksnXPHlcIwMt+BK+5Hpkn6yVSt7ZsQDv TVvcn52MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCRgh3sf/iWnpRXeFrVUd10 TVuUUX59iM9pEQ4JXWtF5l7v5xeuMZf366yS0d5Tt33N6efLe6ecfB8u/HrBNCudKUt+GeRW7ns 1a0+ofXxOnZbWz4uGXQIf2Q8FCBsrczJsPub21+kN31aFD4tP5L5VEXSdd+re/jhh+zi7JPf2nO oahbQ116eLnhWWNI7RnLd6ToNmr5n/zY67Ru7rVsrFVIS8ZLtuF61wgdXhtHf8bRbD24dubpsQO cGqerG9YWCJaXBU34rCabvPvL97SXHbvX/PBBg6zspefrZU+oqLX4ZEzqmMTMP9z2P1ZoRw271k UuLOdxKdNykzZr2P9/cfdT9+9kSmiH1gdH680lFh56RaAA== 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/omap-des.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c index 089dd45eaedd..209d3dc03a9b 100644 --- a/drivers/crypto/omap-des.c +++ b/drivers/crypto/omap-des.c @@ -1072,7 +1072,7 @@ static int omap_des_probe(struct platform_device *pdev) return err; } -static int omap_des_remove(struct platform_device *pdev) +static void omap_des_remove(struct platform_device *pdev) { struct omap_des_dev *dd = platform_get_drvdata(pdev); int i, j; @@ -1089,8 +1089,6 @@ static int omap_des_remove(struct platform_device *pdev) tasklet_kill(&dd->done_task); omap_des_dma_cleanup(dd); pm_runtime_disable(dd->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1117,7 +1115,7 @@ static SIMPLE_DEV_PM_OPS(omap_des_pm_ops, omap_des_suspend, omap_des_resume); static struct platform_driver omap_des_driver = { .probe = omap_des_probe, - .remove = omap_des_remove, + .remove_new = omap_des_remove, .driver = { .name = "omap-des", .pm = &omap_des_pm_ops, From patchwork Fri Oct 20 07:55: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: 736434 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 89C40C004C0 for ; Fri, 20 Oct 2023 07:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376543AbjJTH5P (ORCPT ); Fri, 20 Oct 2023 03:57:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376504AbjJTH4s (ORCPT ); Fri, 20 Oct 2023 03:56:48 -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 8F879D73 for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN5-0003YZ-Os; Fri, 20 Oct 2023 09:56:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN3-002yVz-Tt; Fri, 20 Oct 2023 09:56:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN3-002OKH-Ki; Fri, 20 Oct 2023 09:56:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Thara Gopinath , linux-crypto@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 32/42] crypto: qce - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:54 +0200 Message-ID: <20231020075521.2121571-76-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1896; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=G0/igmENqnZ6cetBxXxRJSgWvtgANtFuylMhEvhkrEs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKOev/uBpsw9uCPahZqZFYXVWH0XyuLyrZ2n hpZuBDHox+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyjgAKCRCPgPtYfRL+ TmgqCACzXUPxe9GXPXocrWR3io0dlnoG8qXO+qNu6fd8JiB8sDCgkZbDZ9Xmfq3Ee4FuxB/HVFw wZt2FPa+3jWFZy7lbtaiPTsViNBGtLt+fvZ04pNNfG5XfscPlcS0cBmRTpIFR/CsDadRRXq6h/v UdTkfly25Fc8DYLuGc8dVfkJ+wYlh2YsrJUqd8dRmh7ws9+OlS9PF0AV480Ze2zlwBxmfFfxn9s FojrBd3LBwWanky3ws71R4/wquSF3m3rV1uLFssO1lQmrRNTQCL5TQFK5AXJeHcYkMaJe66ow1a SOEGUl1cvblO0sxdaRdchp1FQE6M+RrFZCpEMhbtPlrWDJ3E 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/qce/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c index fce49c0dee3e..28b5fd823827 100644 --- a/drivers/crypto/qce/core.c +++ b/drivers/crypto/qce/core.c @@ -277,7 +277,7 @@ static int qce_crypto_probe(struct platform_device *pdev) return ret; } -static int qce_crypto_remove(struct platform_device *pdev) +static void qce_crypto_remove(struct platform_device *pdev) { struct qce_device *qce = platform_get_drvdata(pdev); @@ -287,7 +287,6 @@ static int qce_crypto_remove(struct platform_device *pdev) clk_disable_unprepare(qce->bus); clk_disable_unprepare(qce->iface); clk_disable_unprepare(qce->core); - return 0; } static const struct of_device_id qce_crypto_of_match[] = { @@ -300,7 +299,7 @@ MODULE_DEVICE_TABLE(of, qce_crypto_of_match); static struct platform_driver qce_crypto_driver = { .probe = qce_crypto_probe, - .remove = qce_crypto_remove, + .remove_new = qce_crypto_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = qce_crypto_of_match, From patchwork Fri Oct 20 07:55:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 736427 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 DB829CDB47E for ; Fri, 20 Oct 2023 07:57:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376497AbjJTH5a (ORCPT ); Fri, 20 Oct 2023 03:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376499AbjJTH5E (ORCPT ); Fri, 20 Oct 2023 03:57:04 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E31A1AE for ; Fri, 20 Oct 2023 00:56:47 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN6-0003ZZ-10; Fri, 20 Oct 2023 09:56:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN4-002yW2-41; Fri, 20 Oct 2023 09:56:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN3-002OKM-R5; Fri, 20 Oct 2023 09:56:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 33/42] crypto: qcom-rng - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:55 +0200 Message-ID: <20231020075521.2121571-77-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1712; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kUBCXyNhmAOITBuECHTgq8IeakGTUY+qub8iRJK7S1Y=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjo36fAg6P9pJEzqmXDFT7xP8FSyfdUU+ILGvN3FAft U9MZVInozELAyMXg6yYIot945pMqyq5yM61/y7DDGJlApnCwMUpABN53M7B0HKfTWW3nk3DDBND I3vHP8dtY5292nrlHop1eLdMWHYn+hibqqgDR316Q4Vf2pnHwqnlZXrafa5hv/eulpt5cnL/2Zz bFS+vtuakPmPeqXVhvW3yVo+tXu7817OLl/z6uZA1qNvH78iRZ5yzph5iP/u4wc+PzTPJouBMb5 LQvdlG57csd1y4/bSPZZ7KUUbVgHdztnZ7707f3LJrlvYeZxndB4sFJy2uq/+ePvf03aiF0T7dd znTG/7dc3i8yljCdvodgau750zwLyjyyk+YzFRVOu+Vx5SHv2ebeqyrkMpUCrtztjfs2vtDjz4+ 3HZfflL4fNFEe7WZAsUTX1XZ6/nz/6ndc1Bo6orCbjkrAA== 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/qcom-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/qcom-rng.c b/drivers/crypto/qcom-rng.c index f46b92bb14b5..c670d7d0c11e 100644 --- a/drivers/crypto/qcom-rng.c +++ b/drivers/crypto/qcom-rng.c @@ -224,13 +224,11 @@ static int qcom_rng_probe(struct platform_device *pdev) return ret; } -static int qcom_rng_remove(struct platform_device *pdev) +static void qcom_rng_remove(struct platform_device *pdev) { crypto_unregister_rng(&qcom_rng_alg); qcom_rng_dev = NULL; - - return 0; } static struct qcom_rng_of_data qcom_prng_of_data = { @@ -264,7 +262,7 @@ MODULE_DEVICE_TABLE(of, qcom_rng_of_match); static struct platform_driver qcom_rng_driver = { .probe = qcom_rng_probe, - .remove = qcom_rng_remove, + .remove_new = qcom_rng_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = of_match_ptr(qcom_rng_of_match), From patchwork Fri Oct 20 07:55:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 736430 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 E5537C25B40 for ; Fri, 20 Oct 2023 07:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376508AbjJTH5X (ORCPT ); Fri, 20 Oct 2023 03:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376514AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A83A3D7F for ; Fri, 20 Oct 2023 00:56:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN6-0003bJ-Ci; Fri, 20 Oct 2023 09:56:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN4-002yW5-DU; Fri, 20 Oct 2023 09:56:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN4-002OKQ-47; Fri, 20 Oct 2023 09:56:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Corentin Labbe , Heiko Stuebner , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 34/42] crypto: rockchip/rk3288 - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:56 +0200 Message-ID: <20231020075521.2121571-78-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1829; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OSkAhDdh6kSQDLklGjL3p61jBuTD2vuCyW1G0nBc6KE=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjowm3z2mLOVfsj9qseDcuU47JZLU/S4rYGs64R1+3G QvX7/XvZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAi7IkcDA3aYiz6ce961hiE fnQ/rRpn3Lb+WmXem0wrEe6KRRwbQs6wbpH46aaR2xKqmeN94pPaf2Umz7PG6ip7rJNa5pcYz5M 7xBPF1OH1Lmk3P/+3MwIrjoZt0Jcsuyv0fsZ60Sl5KvuKJyy8Fv21cesv6/XXMi+aX5hXwZ03T3 TzAYPFHjsS55xZVR16NWn62RTXl0VRqW/lBZr4Km10Fx07rRV69NWVg46R/BpeC132+yrf+XVwe Wr93wPn2a16p1ckB5mrbqpsqK3IuBxkrdzYs7mqqvlhzq7jefVaKpcYahI6biUJ23L8LtloXjCx QTs/LPNT7Mrnq1quP0s2mprkPd3rd8p5NY2fTD/X81UDAA== 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/rockchip/rk3288_crypto.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/rockchip/rk3288_crypto.c b/drivers/crypto/rockchip/rk3288_crypto.c index 77d5705a5d96..70edf40bc523 100644 --- a/drivers/crypto/rockchip/rk3288_crypto.c +++ b/drivers/crypto/rockchip/rk3288_crypto.c @@ -405,7 +405,7 @@ static int rk_crypto_probe(struct platform_device *pdev) return err; } -static int rk_crypto_remove(struct platform_device *pdev) +static void rk_crypto_remove(struct platform_device *pdev) { struct rk_crypto_info *crypto_tmp = platform_get_drvdata(pdev); struct rk_crypto_info *first; @@ -424,12 +424,11 @@ static int rk_crypto_remove(struct platform_device *pdev) } rk_crypto_pm_exit(crypto_tmp); crypto_engine_exit(crypto_tmp->engine); - return 0; } static struct platform_driver crypto_driver = { .probe = rk_crypto_probe, - .remove = rk_crypto_remove, + .remove_new = rk_crypto_remove, .driver = { .name = "rk3288-crypto", .pm = &rk_crypto_pm_ops, From patchwork Fri Oct 20 07:55:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 736432 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 D9ADCC001DF for ; Fri, 20 Oct 2023 07:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376481AbjJTH5S (ORCPT ); Fri, 20 Oct 2023 03:57:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376508AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066CED7A for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN6-0003dM-Mo; Fri, 20 Oct 2023 09:56:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN4-002yWG-Pg; Fri, 20 Oct 2023 09:56:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN4-002OKX-Ga; Fri, 20 Oct 2023 09:56:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 36/42] crypto: sa2ul - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:58 +0200 Message-ID: <20231020075521.2121571-80-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1686; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Aq3je/SuIFI0BUC/13Ds8/g4ZpAP1by27NY2YIFlN6Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKTXY1jCFSa5bsS59e3knZYxtJ8qeIoRr195 BTcqfhshoCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIykwAKCRCPgPtYfRL+ TjZsB/0QSrCYq9FWZarcHBDbAOZtbTKic7kNHj+liJ0TKBXoRj5HG4iHG9drMQvZB8LuXHrLhwF MZMGNJACtpBacQjQiAmr+awzGeEI+0xVZvNy//zFVgQaF1Id/raxyrzFInAuMFI5MZPCntZ2YjK vmR7Sf91+cbSw/BIoUJcEG5ev6ZXAWgk4ViS9WgOF9bXlxJyPPkb7A2l9PYsAWNNI9q3zqTHeIh oqca3DTdtH3NvrQgdw3PzCGvCDzLTK1VTCzmvcoJVBvsxzO2oX32zY4X/+fLV7LLrIxW28Ini/e wGdjxmV1AW2nEHNenxei7HzYJM5CrGXvFa71yM3vej7vYtAq 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/sa2ul.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c index 6238d34f8db2..6846a8429574 100644 --- a/drivers/crypto/sa2ul.c +++ b/drivers/crypto/sa2ul.c @@ -2468,7 +2468,7 @@ static int sa_ul_probe(struct platform_device *pdev) return ret; } -static int sa_ul_remove(struct platform_device *pdev) +static void sa_ul_remove(struct platform_device *pdev) { struct sa_crypto_data *dev_data = platform_get_drvdata(pdev); @@ -2486,13 +2486,11 @@ static int sa_ul_remove(struct platform_device *pdev) pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static struct platform_driver sa_ul_driver = { .probe = sa_ul_probe, - .remove = sa_ul_remove, + .remove_new = sa_ul_remove, .driver = { .name = "saul-crypto", .of_match_table = of_match, From patchwork Fri Oct 20 07:55:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 736431 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 B6C54C25B47 for ; Fri, 20 Oct 2023 07:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376507AbjJTH5X (ORCPT ); Fri, 20 Oct 2023 03:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376509AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06752D7B for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN7-0003eq-0Z; Fri, 20 Oct 2023 09:56:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN5-002yWJ-0l; Fri, 20 Oct 2023 09:56:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN4-002OKc-Nc; Fri, 20 Oct 2023 09:56:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 37/42] crypto: sahara - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:59 +0200 Message-ID: <20231020075521.2121571-81-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1678; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IasulRNGt6hUp9eOT/ON/572KWT+hDQFEcV0wFuffAc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKUy64U3nQiv6h6xRWyHVOOSC2vgjfTB2OVY vXLy3iUgxCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIylAAKCRCPgPtYfRL+ TgV+B/4jhV2EAsqgPvffQYyILW5lSt+VH76/zkYYSP3B7hWmZ1hoip1kVp5VJZy/v/7JlZtZBMp VrsQZkQmOwvTz35RcM7bylL3N/X1Xlrn0stlPXkf8W4BTsm8O7VmCW8fyqfU+diVzyr8ZstwrSJ +tqJPpmcNh79Seg6LyToHnn51aTznc7HfcHSjickZuZlRt/EHuxngsReqTqeKw79udjo7ddGEXi irf9ZGWywaZbnTF+HO8QoyCBPiYRTLX6LjtgjTfJhi84rt9doU6ssiCTmQ/5jSrT6jpaXsM0M1g RETiSKZ6kYroZ8pPLqyRdWCaCWmDKFklxiXKX+8+mPY4xzYw 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-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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/crypto/sahara.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c index 62d93526920f..02065131c300 100644 --- a/drivers/crypto/sahara.c +++ b/drivers/crypto/sahara.c @@ -1510,7 +1510,7 @@ static int sahara_probe(struct platform_device *pdev) return err; } -static int sahara_remove(struct platform_device *pdev) +static void sahara_remove(struct platform_device *pdev) { struct sahara_dev *dev = platform_get_drvdata(pdev); @@ -1522,13 +1522,11 @@ static int sahara_remove(struct platform_device *pdev) clk_disable_unprepare(dev->clk_ahb); dev_ptr = NULL; - - return 0; } static struct platform_driver sahara_driver = { .probe = sahara_probe, - .remove = sahara_remove, + .remove_new = sahara_remove, .driver = { .name = SAHARA_NAME, .of_match_table = sahara_dt_ids,