From patchwork Sun Dec 10 22:12:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752634 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 7A5F0D5 for ; Sun, 10 Dec 2023 14:12:53 -0800 (PST) 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 1rCS2X-0006Od-KH; Sun, 10 Dec 2023 23:12:45 +0100 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 1rCS2S-00ExXr-IF; Sun, 10 Dec 2023 23:12:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2S-000RVo-98; Sun, 10 Dec 2023 23:12:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Rob Herring , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 01/12] hwrng: atmel - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:16 +0100 Message-ID: <89f6eebfa85b31c635b774e613f19b84b32f3e1f.1702245873.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1870; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=GmbNDaUhHwKyIVnew22ILj2umAeQoC+JyFObDDBbKhg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfAjlFLaqqtL+Rs91coinoQ6dAlqCg7J72OO U7JTxxI/Y+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3wAAKCRCPgPtYfRL+ TqT9B/9AzeQcDsubCeCc7ASpZHLCqp+QZFrbL0YBSSbkX93vuDAfIqvoNgCBknvBjhxaS3h6Uoe cPQ2w5nBHLg0OGAoO3sva4O0Oc3TDc6Rg6C3/NI4VdevUI7TabhW6TVJVSC+BTfhCfQQvYdUzwK QkLDycHQniRHNd1j6kT11x0a2OaUtjnPCdbcZSthUYQLMs6IV5UgijayXtIu6kaW1ST9G9Xi5Zs j4eUaO3pkqJ5I6z0snz36okix/e8MYl3otboKmmWvpawPtm5aKYNN6W/QCsOsGgIH1oJF1tuv4v aLKGy1kprQW1gDXR/lieS/ezgbW97z1k2fwQAYm/DBl1CxQO 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 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Nicolas Ferre --- drivers/char/hw_random/atmel-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c index a37367ebcbac..e9157255f851 100644 --- a/drivers/char/hw_random/atmel-rng.c +++ b/drivers/char/hw_random/atmel-rng.c @@ -161,15 +161,13 @@ static int atmel_trng_probe(struct platform_device *pdev) return ret; } -static int atmel_trng_remove(struct platform_device *pdev) +static void atmel_trng_remove(struct platform_device *pdev) { struct atmel_trng *trng = platform_get_drvdata(pdev); atmel_trng_cleanup(trng); pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); - - return 0; } static int __maybe_unused atmel_trng_runtime_suspend(struct device *dev) @@ -218,7 +216,7 @@ MODULE_DEVICE_TABLE(of, atmel_trng_dt_ids); static struct platform_driver atmel_trng_driver = { .probe = atmel_trng_probe, - .remove = atmel_trng_remove, + .remove_new = atmel_trng_remove, .driver = { .name = "atmel-trng", .pm = pm_ptr(&atmel_trng_pm_ops), From patchwork Sun Dec 10 22:12:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752383 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 0638AF1 for ; Sun, 10 Dec 2023 14:12:50 -0800 (PST) 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 1rCS2X-0006Oe-12; Sun, 10 Dec 2023 23:12:45 +0100 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 1rCS2S-00ExXu-TN; Sun, 10 Dec 2023 23:12:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2S-000RVs-KN; Sun, 10 Dec 2023 23:12:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Hadar Gat , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/12] hwrng: cctrng - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:17 +0100 Message-ID: <12bbad702295f61973f7748202d974c1ce0a1ffd.1702245873.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1853; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=og/MzwfUHeURuBEhoT2JDT4GfuRVh9ytkXP407qamAw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfBwAFzkLCXDU51FssjUbiXsuSDkxgSYi1lm ZrMwZLW7oCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3wQAKCRCPgPtYfRL+ TpB7B/41WZTzMuKei168iiuj1+4u12AjSjAwLxH6aZlinG+OQJt7iPj4Dqhba92D2VHbO3/LjBo HW6dfQGu/6Vakkc3NBIUqqjq70PAK1v+zAHUXHBYerD2r/B/P0TxEhzWzaifyFTjW979HxRvls1 ol/boVwCLg1s1+zS478pEk8R+IbJkbaQPqAB8XsREiHQ/SHGWvNrDJtR84QrE2DnJ0Gp6Qgw/cd j3NQEeoxEK2OO0lS9NwLuckDFfhHkcOaNvjuOaztLVkWIFBIQHJLPlQZpbbznreyE3XoKQ3A0hl Lom/YK4RT/H3V/pGFSdso0vvh26RkZp70sxSKVPNP7ybxtkO 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 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/char/hw_random/cctrng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c index 1abbff04a015..c0d2f824769f 100644 --- a/drivers/char/hw_random/cctrng.c +++ b/drivers/char/hw_random/cctrng.c @@ -560,7 +560,7 @@ static int cctrng_probe(struct platform_device *pdev) return rc; } -static int cctrng_remove(struct platform_device *pdev) +static void cctrng_remove(struct platform_device *pdev) { struct cctrng_drvdata *drvdata = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; @@ -570,8 +570,6 @@ static int cctrng_remove(struct platform_device *pdev) cc_trng_pm_fini(drvdata); dev_info(dev, "ARM cctrng device terminated\n"); - - return 0; } static int __maybe_unused cctrng_suspend(struct device *dev) @@ -654,7 +652,7 @@ static struct platform_driver cctrng_driver = { .pm = &cctrng_pm, }, .probe = cctrng_probe, - .remove = cctrng_remove, + .remove_new = cctrng_remove, }; module_platform_driver(cctrng_driver); From patchwork Sun Dec 10 22:12:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752380 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 DD676FC for ; Sun, 10 Dec 2023 14:12:53 -0800 (PST) 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 1rCS2X-0006Of-R0; Sun, 10 Dec 2023 23:12:45 +0100 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 1rCS2T-00ExXx-5k; Sun, 10 Dec 2023 23:12:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2S-000RVw-Sp; Sun, 10 Dec 2023 23:12:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: =?utf-8?q?=C5=81ukasz_Stelmach?= , Krzysztof Kozlowski , Alim Akhtar , linux-samsung-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 03/12] hwrng: exynos - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:18 +0100 Message-ID: <817e91f7bb257745c0fb483037b83c1a6ba14e75.1702245873.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1892; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=n55rfa/lUXGB2/hckh9miapviN5gRi067G9G5cA6tPg=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtQy80OzJxX9EZyQstk3oj2cQ/y5av9KFeUZPcpPXKbwc oTzK57rZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAi1+TY//uuMfPrb37feXCa ln/WCr+mpKkq/MtSuzZ/u35X8kpefSq/q1rkb8HyvsKn946VWiuHH1yyn0nXatMlZ6X8jkb1Sev EtzhkHxE69fzZ47hPQr0e+1v7VObtEtoS2McoEXbqApfHC38b4ex/N1t7+BiNb0ydWiYVYfHu0W sdnW+yEdenrExxzetwf7a45k/XXjWPx+eq1/1j6lSydK0Re5yovl9OcUJWZC1fVBqrbbu375bXR f43nuy46/op1V+P0c6o8M2kld9zL8/0TE1+dfjSzUAd5fInNmeP3032dS11WZv6XXP3jYfNE8Sv /hERf2DGFLAzTXtRiFqOdFPQBBdB9vjk+OfuRv9/V0UAAA== 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 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Lukasz Stelmach --- drivers/char/hw_random/exynos-trng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c index 30207b7ac5f4..0ed5d22fe667 100644 --- a/drivers/char/hw_random/exynos-trng.c +++ b/drivers/char/hw_random/exynos-trng.c @@ -173,7 +173,7 @@ static int exynos_trng_probe(struct platform_device *pdev) return ret; } -static int exynos_trng_remove(struct platform_device *pdev) +static void exynos_trng_remove(struct platform_device *pdev) { struct exynos_trng_dev *trng = platform_get_drvdata(pdev); @@ -181,8 +181,6 @@ static int exynos_trng_remove(struct platform_device *pdev) pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static int exynos_trng_suspend(struct device *dev) @@ -223,7 +221,7 @@ static struct platform_driver exynos_trng_driver = { .of_match_table = exynos_trng_dt_match, }, .probe = exynos_trng_probe, - .remove = exynos_trng_remove, + .remove_new = exynos_trng_remove, }; module_platform_driver(exynos_trng_driver); From patchwork Sun Dec 10 22:12:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752636 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 F368FD9 for ; Sun, 10 Dec 2023 14:12:49 -0800 (PST) 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 1rCS2W-0006Og-Ky; Sun, 10 Dec 2023 23:12:44 +0100 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 1rCS2T-00ExY0-DC; Sun, 10 Dec 2023 23:12:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2T-000RW0-48; Sun, 10 Dec 2023 23:12:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Rob Herring , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/12] hwrng: ingenic - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:19 +0100 Message-ID: <98f6381830d8134693e874c3771165a117e2d8e7.1702245873.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1862; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=BzSzY+egDa38u2fJq725qloJVp+pK7gT9Jw7wYVpys4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfDWaKwPBgf7VfTqdxPsmep4C6oEeMEGZULJ urcZha/+U6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3wwAKCRCPgPtYfRL+ TkeHB/9IErYhK93v9gJT3vegRHgSCgRUb9hD/XqDOsahUZX+ap+KBklpcSINVzglAEDEawUckIf i3SMKPGWvuIwISj+BCEXMHkfpYqR3EcrIrYb6RGBLn5m3X7x6gcTzLS7lLYu1BEr+IAwn/dn2XW TZ1yn4y4zght9Z15/VEJKBui91iZ2GTVn8VntO7iyl2a7+FpZ+IwbjqPyKlNsf5jv44JGtkLAOU FFf3MYNYA64o8z/nYi/jHahdWPcRfoaT8ke/T7V0Fl+ztgW+GOhTxyZNsNd32/pynvfEunxNaKC EdR3CfPjN1tK0XyF+ZgoBx8EzyOhVmxAIPjMk5pqfzFByp+P 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 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/char/hw_random/ingenic-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/ingenic-rng.c b/drivers/char/hw_random/ingenic-rng.c index c74ded64fbe3..2f9b6483c4a1 100644 --- a/drivers/char/hw_random/ingenic-rng.c +++ b/drivers/char/hw_random/ingenic-rng.c @@ -114,15 +114,13 @@ static int ingenic_rng_probe(struct platform_device *pdev) return 0; } -static int ingenic_rng_remove(struct platform_device *pdev) +static void ingenic_rng_remove(struct platform_device *pdev) { struct ingenic_rng *priv = platform_get_drvdata(pdev); hwrng_unregister(&priv->rng); writel(0, priv->base + RNG_REG_ERNG_OFFSET); - - return 0; } static const struct of_device_id ingenic_rng_of_match[] = { @@ -134,7 +132,7 @@ MODULE_DEVICE_TABLE(of, ingenic_rng_of_match); static struct platform_driver ingenic_rng_driver = { .probe = ingenic_rng_probe, - .remove = ingenic_rng_remove, + .remove_new = ingenic_rng_remove, .driver = { .name = "ingenic-rng", .of_match_table = ingenic_rng_of_match, From patchwork Sun Dec 10 22:12:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752384 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 B11F6D6 for ; Sun, 10 Dec 2023 14:12:49 -0800 (PST) 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 1rCS2X-0006Oh-8C; Sun, 10 Dec 2023 23:12:45 +0100 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 1rCS2T-00ExY3-MF; Sun, 10 Dec 2023 23:12:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2T-000RW4-DD; Sun, 10 Dec 2023 23:12:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Martin Kaiser , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/12] hwrng: ks-sa - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:20 +0100 Message-ID: <159e2800fe1412090a33884f4a8b9cae24b3d28f.1702245873.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1770; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=WpUWyc5StSRgNEpaQ04zjgxYp4K0Xqr+B/hROAvvVE4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfElnlO4Y6Ge+qeStX52B/XbeTTaUFUZ95zB efifYQDRnWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3xAAKCRCPgPtYfRL+ Tk2kCAC7I3d4CFuamh7B8TmLhet9XFbS5C6uvP2cgh3Y2WEuxnyrz4HwbR/DkemAwBYBjd6tgPs pFEItmYKVdq0aePCPENQ/CAV7BaR/qFylWBbMv7JlqJks4wN14pzQMAFG7A6hL6EcN+FGMXqKWf MO2K0TTdWxhxJrUUImxUqN6yw/F2OZi3z6PxhXOOgpwp0xk8EavuMWt/oL+qI93CHFviTJSsysR ZAOdDzI6YNd6MX8GS9uebFYmibI/AR3xyEGTK6w3oFrlf6mzJlS7Va/4xNJlgZBUpmE6SdJzQlS vqgc4audiibzNj3pYOhN+ZDy5y4GBsDmI35kx516rrhOOsMl 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 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/char/hw_random/ks-sa-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/ks-sa-rng.c b/drivers/char/hw_random/ks-sa-rng.c index dff7b9db7044..36c34252b4f6 100644 --- a/drivers/char/hw_random/ks-sa-rng.c +++ b/drivers/char/hw_random/ks-sa-rng.c @@ -241,12 +241,10 @@ static int ks_sa_rng_probe(struct platform_device *pdev) return devm_hwrng_register(&pdev->dev, &ks_sa_rng->rng); } -static int ks_sa_rng_remove(struct platform_device *pdev) +static void ks_sa_rng_remove(struct platform_device *pdev) { pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static const struct of_device_id ks_sa_rng_dt_match[] = { @@ -263,7 +261,7 @@ static struct platform_driver ks_sa_rng_driver = { .of_match_table = ks_sa_rng_dt_match, }, .probe = ks_sa_rng_probe, - .remove = ks_sa_rng_remove, + .remove_new = ks_sa_rng_remove, }; module_platform_driver(ks_sa_rng_driver); From patchwork Sun Dec 10 22:12:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752637 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 12A07CF for ; Sun, 10 Dec 2023 14:12:49 -0800 (PST) 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 1rCS2W-0006Oi-Kx; Sun, 10 Dec 2023 23:12:44 +0100 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 1rCS2T-00ExY6-Tc; Sun, 10 Dec 2023 23:12:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2T-000RW8-KW; Sun, 10 Dec 2023 23:12:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/12] hwrng: mxc - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:21 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1835; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=aWklsF4m7KKS+I4Wu0a1XcRMXztlVelCPKUldjZc5lU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfGnlS9qcVg8DF1/UVfFAhCNntrcLhQhl/bO onS9PJT3zqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3xgAKCRCPgPtYfRL+ TkRyB/9eGmF+oyV93mG2GqUCsKtWDoglXP47aDDsEkzLD+tlsMSaXQ3XL7VYbEj2a597AVRDjSJ rasTo4nUCMz55qGppijQWoGD0thOJRpbx1KZ5DejYAg6fMWwRLyC+wXocL+8dHUYUjIEAOPfEwu OaAS3Debw0pWlkuFrVrAJa23MEqST0uwbcP4dxXeDA3LfOQAlWbLQaaIW8gttVULD74271NtVg3 s3EjmulKkLDK9zUBpqDJsyvKkqxaXDdltGZphTSMGnsMup9EGX19zKygApLVK4iVDRca3vAf28X l0ao+HU+UZHISJ2ZWKKX/vgGA7tpVpewP9Em7YQ9FUD8r0Fa 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 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/char/hw_random/mxc-rnga.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/mxc-rnga.c b/drivers/char/hw_random/mxc-rnga.c index 008763c988ed..07ec000e4cd7 100644 --- a/drivers/char/hw_random/mxc-rnga.c +++ b/drivers/char/hw_random/mxc-rnga.c @@ -176,15 +176,13 @@ static int __init mxc_rnga_probe(struct platform_device *pdev) return err; } -static int __exit mxc_rnga_remove(struct platform_device *pdev) +static void __exit mxc_rnga_remove(struct platform_device *pdev) { struct mxc_rng *mxc_rng = platform_get_drvdata(pdev); hwrng_unregister(&mxc_rng->rng); clk_disable_unprepare(mxc_rng->clk); - - return 0; } static const struct of_device_id mxc_rnga_of_match[] = { @@ -199,7 +197,7 @@ static struct platform_driver mxc_rnga_driver = { .name = "mxc_rnga", .of_match_table = mxc_rnga_of_match, }, - .remove = __exit_p(mxc_rnga_remove), + .remove_new = __exit_p(mxc_rnga_remove), }; module_platform_driver_probe(mxc_rnga_driver, mxc_rnga_probe); From patchwork Sun Dec 10 22:12:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752381 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 ECF64D8 for ; Sun, 10 Dec 2023 14:12:49 -0800 (PST) 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 1rCS2W-0006Ox-Ky; Sun, 10 Dec 2023 23:12:44 +0100 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 1rCS2U-00ExY9-6N; Sun, 10 Dec 2023 23:12:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2T-000RWM-TM; Sun, 10 Dec 2023 23:12:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Rob Herring , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/12] hwrng: n2 - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:22 +0100 Message-ID: <8a470b0d899f42d49c679ff763d3133a109830b2.1702245873.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1785; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=8DSLRtuH+m4SMxX9zwxvj2v6domeulWXdRnv2oPApBI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfHJdbX/wTFWIIxAplaJw+kOoz5Zd89+LgU3 3YIdsB068qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3xwAKCRCPgPtYfRL+ TtyvCACKcLL8YKWZbPbDToddG6ilsbTeNS/VGvFFmodKoqHEueCRgZnOLr7vgTbtgLfp4V6XRl+ UMh/cGqLnmbyCQ22EChCtuvmrOnKrsLZF9NfyUZ6G/Tqx7E+ekeCMHqfHQ4QqfbwlWF/T/EfZYG Xopwqfa2I3X4cEyE48cCuDopkpF7kdm9kn18jca18OyOmuiAV94/QNl531XCY8MauZ+vnlc9ofS x55CEQAuRt213ThTbN2xYNsWmOl8G+ve0zwTuvU29MnN1YXZfTnv/RqUbVPu3prGR2enUC4DmQX GSX5p014NuOMcUxK0D1TkfY2qQ+jsYbctshTBbTQFa27MWFc 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 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/char/hw_random/n2-drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c index aaae16b98475..2e669e7c14d3 100644 --- a/drivers/char/hw_random/n2-drv.c +++ b/drivers/char/hw_random/n2-drv.c @@ -781,7 +781,7 @@ static int n2rng_probe(struct platform_device *op) return err; } -static int n2rng_remove(struct platform_device *op) +static void n2rng_remove(struct platform_device *op) { struct n2rng *np = platform_get_drvdata(op); @@ -790,8 +790,6 @@ static int n2rng_remove(struct platform_device *op) cancel_delayed_work_sync(&np->work); sun4v_hvapi_unregister(HV_GRP_RNG); - - return 0; } static struct n2rng_template n2_template = { @@ -860,7 +858,7 @@ static struct platform_driver n2rng_driver = { .of_match_table = n2rng_match, }, .probe = n2rng_probe, - .remove = n2rng_remove, + .remove_new = n2rng_remove, }; module_platform_driver(n2rng_driver); From patchwork Sun Dec 10 22:12:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752382 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 45211F3 for ; Sun, 10 Dec 2023 14:12:52 -0800 (PST) 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 1rCS2W-0006Oy-UR; Sun, 10 Dec 2023 23:12:44 +0100 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 1rCS2U-00ExYC-Do; Sun, 10 Dec 2023 23:12:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2U-000RWQ-4g; Sun, 10 Dec 2023 23:12:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , openbmc@lists.ozlabs.org, linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/12] hwrng: npcm - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:23 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1787; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=MuGl9Pi4du6aDKFhb44ZUIU1I3q41zByvx0vfz3i41g=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfI6ggc1VYruEGcrSh92NPHvPtjsOYybF78I 0GLTXesNLGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3yAAKCRCPgPtYfRL+ ToIjB/0cwvqloENXYLTCrsQoQM5KyK7tYCvgofA5HhRvmFooSWKH622upb1j9DGqYeIWYP1+blz WTD9Yh2+AeiHGILYNCQlnTZioP1F5dOwoMZINC1vA5xF0HnHV9R62osPbvGnTyMz7oVr4YZb/+O e43ibfm6Gx++mMH4OZJ4Vi2g78dP4lWFSSdwQyD7ojkfGi1XeHpljA41ujzJd35ddCbiaYJI7k+ Mf6ohtSWKCxf5mjZLL0EFuenz28xFuroQS9W28iBu+zbG+kRIhCHaz+unE7q7tpNxzDq62DKr2B y9l3aB+uStiRgEONbP3l1ula+SJ4WFylwXMKXcWzTr3MXZ5O 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 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/char/hw_random/npcm-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/npcm-rng.c b/drivers/char/hw_random/npcm-rng.c index 8a304b754217..bce8c4829a1f 100644 --- a/drivers/char/hw_random/npcm-rng.c +++ b/drivers/char/hw_random/npcm-rng.c @@ -126,15 +126,13 @@ static int npcm_rng_probe(struct platform_device *pdev) return 0; } -static int npcm_rng_remove(struct platform_device *pdev) +static void npcm_rng_remove(struct platform_device *pdev) { struct npcm_rng *priv = platform_get_drvdata(pdev); devm_hwrng_unregister(&pdev->dev, &priv->rng); pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); - - return 0; } #ifdef CONFIG_PM @@ -178,7 +176,7 @@ static struct platform_driver npcm_rng_driver = { .of_match_table = of_match_ptr(rng_dt_id), }, .probe = npcm_rng_probe, - .remove = npcm_rng_remove, + .remove_new = npcm_rng_remove, }; module_platform_driver(npcm_rng_driver); From patchwork Sun Dec 10 22:12:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752385 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 A9356D5 for ; Sun, 10 Dec 2023 14:12:49 -0800 (PST) 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 1rCS2X-0006Oz-36; Sun, 10 Dec 2023 23:12:45 +0100 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 1rCS2U-00ExYF-NY; Sun, 10 Dec 2023 23:12:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2U-000RWU-EL; Sun, 10 Dec 2023 23:12:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Deepak Saxena , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/12] hwrng: omap - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:24 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1878; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=LfUR14esOo8oEFXn7iRhYS5wKFCP5zWPXp6cKLmQ68A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfJ4k9pmj/OWf8r30NDz3h+byxGGc2Ty8xDu 7gpM2R4Vz+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3yQAKCRCPgPtYfRL+ To22CACbE1sSOtnN4RHFx7kDvy/pll0IlUcR+ZVvcOQ0I10z29krE05S+iVwBCicdBECyMBsUha 9LuQKR2d/xy7+Oe4GjMSfXsnq51cowNKKWCvhxwvA+G0FmGPhmQa9DFR/fw8/OI9pqSOEAOoF5r N+y+y13qGyVHoiQ+q+75lH1JKrWcraU75EJs1csKSyCd2SDOTzznr8jznQdOSxE7KuQHBggIEUp W+UXayUc9lBsf2iOEW1UqE3frJEPWeXSKo+kHQlZhS0U4U9anL4tOduzO7PB1FMF4cocxYZODco JsfKv6mZ79sowdqwq9EOa6j4P/qpSJveJqxOLSwuSkhG/iKF 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 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/char/hw_random/omap-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index be03f76a2a80..d4c02e900466 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c @@ -509,7 +509,7 @@ static int omap_rng_probe(struct platform_device *pdev) return ret; } -static int omap_rng_remove(struct platform_device *pdev) +static void omap_rng_remove(struct platform_device *pdev) { struct omap_rng_dev *priv = platform_get_drvdata(pdev); @@ -521,8 +521,6 @@ static int omap_rng_remove(struct platform_device *pdev) clk_disable_unprepare(priv->clk); clk_disable_unprepare(priv->clk_reg); - - return 0; } static int __maybe_unused omap_rng_suspend(struct device *dev) @@ -560,7 +558,7 @@ static struct platform_driver omap_rng_driver = { .of_match_table = of_match_ptr(omap_rng_of_match), }, .probe = omap_rng_probe, - .remove = omap_rng_remove, + .remove_new = omap_rng_remove, }; module_platform_driver(omap_rng_driver); From patchwork Sun Dec 10 22:12: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: 752633 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 C5672F4 for ; Sun, 10 Dec 2023 14:12:53 -0800 (PST) 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 1rCS2a-0006P0-BC; Sun, 10 Dec 2023 23:12:48 +0100 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 1rCS2U-00ExYI-U3; Sun, 10 Dec 2023 23:12:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2U-000RWY-Ks; Sun, 10 Dec 2023 23:12:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Maxime Coquelin , Alexandre Torgue , Gatien Chevallier , Rob Herring , linux-crypto@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 10/12] hwrng: stm32 - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:25 +0100 Message-ID: <855e8e89de0c0e2a82e181b883275754f8c16a38.1702245873.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1686; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=tJ2yKb21/v8dgfuhgALzaxDexLMP8sgVYPpXDzQrTKs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfKeIvGJORSVKGHwwwyFKf7y9MUJlfleH1Jl DiYf7f3Vr+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3ygAKCRCPgPtYfRL+ TtbwCACuhFqANg8WSx60uhQJSpr0JdPEteh6pcmqE2mfzI4AetRrLIKWj1F8o/MM6mj3cU8M+4S hcitsrZA76q3cL4RTQFzPX8JkrSwm4OjxGDEQFOrAa/l69INUglpYKYPEFBrrLks8D/HDJ2Ift7 rKB3lNgzJ7lTJe+SpojQGsoe5gLsxivIIcc4XsVJ0iuoDVp57EN5iyVZoA+mGSTvkQwi44SaX8Q VUbOiHSuksPBkyd8R06N588Wo369O08Ff6WCrv/QbArB+eI+pjwBKaW7YNTIA9cVbfxX+/qKx+z 99S4hJ0pj3y0TEfK3h400SL6iP3K9C10AE+L30YTDOrqLhro 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 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/char/hw_random/stm32-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c index 41e1dbea5d2e..98c92b914cfd 100644 --- a/drivers/char/hw_random/stm32-rng.c +++ b/drivers/char/hw_random/stm32-rng.c @@ -362,11 +362,9 @@ static int stm32_rng_init(struct hwrng *rng) return 0; } -static int stm32_rng_remove(struct platform_device *ofdev) +static void stm32_rng_remove(struct platform_device *ofdev) { pm_runtime_disable(&ofdev->dev); - - return 0; } static int __maybe_unused stm32_rng_runtime_suspend(struct device *dev) @@ -557,7 +555,7 @@ static struct platform_driver stm32_rng_driver = { .of_match_table = stm32_rng_match, }, .probe = stm32_rng_probe, - .remove = stm32_rng_remove, + .remove_new = stm32_rng_remove, }; module_platform_driver(stm32_rng_driver); From patchwork Sun Dec 10 22:12:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 752635 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 B9022F2 for ; Sun, 10 Dec 2023 14:12:51 -0800 (PST) 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 1rCS2a-0006P1-HV; Sun, 10 Dec 2023 23:12:48 +0100 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 1rCS2V-00ExYL-4i; Sun, 10 Dec 2023 23:12:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2U-000RWc-Rr; Sun, 10 Dec 2023 23:12:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Martin Kaiser , Yangtao Li , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/12] hwrng: timeriomem - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:26 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1826; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=GoyYhW4hqUD9otfip9b0ONnav2BwKPc9Zk90sy92jcc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfMZsY79aVg6OTRVxuPEwEwxPs3Oa6gJt+uI I5yFQJcnDuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3zAAKCRCPgPtYfRL+ TuzEB/9Csdi0tK9fgYn3RExFiJcfEWtBoVJj+JqHIcP+uaCOL9mOblmxi5Mpi2R197nNFLAggt0 nNZwf0s4jVQoB1Zdqv6hyCOUPooH3QUogSM1R6RH44xVmw7OwM0sU8C4ZFS6ruTGvKivcVgr4Rn 7FbVq7I1VNTH+9Mc3NlLPywE2qdhAZ2VryTk9NsY3OUev43p6K1yesniobyWC+OyeX5OF0ISuH0 oTgCYllJwukj5QkHp6sDgdWXl/VnFdmsmfSBh2vrHCltKPW0yI1xMWNQqg9b1XuPfWmnPGxKwW/ 5aKm3bUmkGn0MRGhybRbVKpF8iblIXuaNFHCr5WL7Zn+CZcu 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 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/char/hw_random/timeriomem-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c index 3db9d868efb1..65b8260339f5 100644 --- a/drivers/char/hw_random/timeriomem-rng.c +++ b/drivers/char/hw_random/timeriomem-rng.c @@ -174,13 +174,11 @@ static int timeriomem_rng_probe(struct platform_device *pdev) return 0; } -static int timeriomem_rng_remove(struct platform_device *pdev) +static void timeriomem_rng_remove(struct platform_device *pdev) { struct timeriomem_rng_private *priv = platform_get_drvdata(pdev); hrtimer_cancel(&priv->timer); - - return 0; } static const struct of_device_id timeriomem_rng_match[] = { @@ -195,7 +193,7 @@ static struct platform_driver timeriomem_rng_driver = { .of_match_table = timeriomem_rng_match, }, .probe = timeriomem_rng_probe, - .remove = timeriomem_rng_remove, + .remove_new = timeriomem_rng_remove, }; module_platform_driver(timeriomem_rng_driver); From patchwork Sun Dec 10 22:12: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: 752632 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 DA856D5 for ; Sun, 10 Dec 2023 14:12:59 -0800 (PST) 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 1rCS2a-0006P2-Om; Sun, 10 Dec 2023 23:12:48 +0100 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 1rCS2V-00ExYO-BZ; Sun, 10 Dec 2023 23:12:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rCS2V-000RWg-2M; Sun, 10 Dec 2023 23:12:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Olivia Mackall , Herbert Xu Cc: Rob Herring , Yu Zhe , Alexandru Ardelean , Andrei Coardos , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/12] hwrng: xgene - Convert to platform remove callback returning void Date: Sun, 10 Dec 2023 23:12:27 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1817; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=mN7xk7QsPOcC0j/g54df2+kqbjC/D4ebugbpGZYp7CA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBldjfNynOBaBsJSCGl8hNZg+be4mu/4NwIYnf2x KEZFiauQWGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXY3zQAKCRCPgPtYfRL+ TtkrCACBWB9zjTG7BZO7yYsXtfz1fTzQ71AHPthrvZgeo1E+iXm8MjhD3RkQNbs8LwDcOYczR8P MUvwSmOdhWT7t9rvVZ7aJBbe/q83uE3572pNSRYHgVojWcu4UcYt+0IOw9hdTzrMJtvU/nEPAih +uaTNIyGitBeBXW8NyroVvfzmF1bF1Of4kw3y4jKE4Wwh+U535vZZUo5YcZfkegHNgwjPtLpD7u Efu6AO29iOTY7lGdSxiSiI43Os+mmavdtarN2yVeCxyEFGSTyX3tLIJI1d4DjigArWe5K+NPn6h L93lS/dmxYDKnL5/lqt0fk4IIZy4zmx9JrZidG6ldGzsi24R 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 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/char/hw_random/xgene-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/xgene-rng.c b/drivers/char/hw_random/xgene-rng.c index 7382724bf501..642d13519464 100644 --- a/drivers/char/hw_random/xgene-rng.c +++ b/drivers/char/hw_random/xgene-rng.c @@ -357,15 +357,13 @@ static int xgene_rng_probe(struct platform_device *pdev) return 0; } -static int xgene_rng_remove(struct platform_device *pdev) +static void xgene_rng_remove(struct platform_device *pdev) { int rc; rc = device_init_wakeup(&pdev->dev, 0); if (rc) dev_err(&pdev->dev, "RNG init wakeup failed error %d\n", rc); - - return 0; } static const struct of_device_id xgene_rng_of_match[] = { @@ -377,7 +375,7 @@ MODULE_DEVICE_TABLE(of, xgene_rng_of_match); static struct platform_driver xgene_rng_driver = { .probe = xgene_rng_probe, - .remove = xgene_rng_remove, + .remove_new = xgene_rng_remove, .driver = { .name = "xgene-rng", .of_match_table = xgene_rng_of_match,