From nobody Thu Nov 14 05:23:32 2024 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 80B4FCE7A89 for ; Mon, 25 Sep 2023 09:56:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230460AbjIYJ43 (ORCPT ); Mon, 25 Sep 2023 05:56:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbjIYJzw (ORCPT ); Mon, 25 Sep 2023 05:55:52 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32F88CF for ; Mon, 25 Sep 2023 02:55: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 1qkiJV-0007m4-Cv; Mon, 25 Sep 2023 11:55: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 1qkiJT-008pye-W7; Mon, 25 Sep 2023 11:55:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJT-004dkQ-My; Mon, 25 Sep 2023 11:55:35 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Joel Stanley Cc: Andrew Jeffery , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 01/40] soc/aspeed: aspeed-lpc-ctrl: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:54:52 +0200 Message-Id: <20230925095532.1984344-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1863; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=T10onqHn9x5uUIg8BoRhKK1riwY5cUpQ2GEK0NPd3eU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhBGcn3H1WzwJha96bFOmLylL/5ZWUmdaf+6 I2kmTRasseJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYQQAKCRCPgPtYfRL+ ToJXB/oDQK1c2RVaj3HT1cFLqS0t5Kj2Z4VO1+1stBxATVkTrh6M5YnZnCd5X/oBGqZs4sEphpl 2qN2hiWYtlB6QsVkZph+lRVoYde9LJPTabvgU7DVh53UJ9fsgB17OzTx8QDiAEbjY9wb39AzvcH pIsyBU5Bzc2ueb8GILG8TOXMys5h1xMwnXUItIDFyDjCxWv4m7Jx0HVmlrVndL1l7b7LFzGr3IA 2FDDbEU85VC5GwjuTEqj1EKtN4zdSoVF9ZIe+/5nV3720fM5fomOwB0GLiAN7giPAtGPbADbCxn up/TSd62i75ftljnxjNYZrdiZubkMV9A+rLSx30ht7XOr5QR X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom Reviewed-by: Andrew Jeffery --- drivers/soc/aspeed/aspeed-lpc-ctrl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/aspeed/aspeed-lpc-ctrl.c b/drivers/soc/aspeed/aspe= ed-lpc-ctrl.c index 258894ed234b..e87038009d1b 100644 --- a/drivers/soc/aspeed/aspeed-lpc-ctrl.c +++ b/drivers/soc/aspeed/aspeed-lpc-ctrl.c @@ -332,14 +332,12 @@ static int aspeed_lpc_ctrl_probe(struct platform_devi= ce *pdev) return rc; } =20 -static int aspeed_lpc_ctrl_remove(struct platform_device *pdev) +static void aspeed_lpc_ctrl_remove(struct platform_device *pdev) { struct aspeed_lpc_ctrl *lpc_ctrl =3D dev_get_drvdata(&pdev->dev); =20 misc_deregister(&lpc_ctrl->miscdev); clk_disable_unprepare(lpc_ctrl->clk); - - return 0; } =20 static const struct of_device_id aspeed_lpc_ctrl_match[] =3D { @@ -355,7 +353,7 @@ static struct platform_driver aspeed_lpc_ctrl_driver = =3D { .of_match_table =3D aspeed_lpc_ctrl_match, }, .probe =3D aspeed_lpc_ctrl_probe, - .remove =3D aspeed_lpc_ctrl_remove, + .remove_new =3D aspeed_lpc_ctrl_remove, }; =20 module_platform_driver(aspeed_lpc_ctrl_driver); --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 EB090CE7A89 for ; Mon, 25 Sep 2023 09:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230493AbjIYJ5R (ORCPT ); Mon, 25 Sep 2023 05:57:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230219AbjIYJ4D (ORCPT ); Mon, 25 Sep 2023 05:56: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 78B45111 for ; Mon, 25 Sep 2023 02:55:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJV-0007m5-FZ; Mon, 25 Sep 2023 11:55: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 1qkiJU-008pyh-5O; Mon, 25 Sep 2023 11:55:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJT-004dkT-SK; Mon, 25 Sep 2023 11:55:35 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Joel Stanley Cc: Andrew Jeffery , Rob Herring , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/40] soc/aspeed: aspeed-lpc-snoop: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:54:53 +0200 Message-Id: <20230925095532.1984344-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1980; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=s5OXo8IjgAIoOI++baFbct5qYs8LXAKnsMuTokxyM5s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhCYZmwTQwRwpaBlgiWgdCOR1poUdZzdTNfO 289e8PgCMWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYQgAKCRCPgPtYfRL+ TiiWCACkZztwtGfEP0fOadeVp7hs+MCNN6d4UUjfO6Zsy8gNVffQtSyDmsLykYeJXelouzQRYYb BV/LFAVygkQaOKh3jf5umpHqgvB/j+1p0WYnHMhgi/EzjsAblt3X7nhl+ehDVrNJiO+X1oe1LY2 yAFJr2tQ4/XNl4TrglNSENIWhYK7QbOeIhJrFyth0VFyPhSKPbI6YJUrMG5xQvQaVJDQzoQk61t Y+v5GPuJXG24/9N7pHC15ECE7JRkBQ7iNgQHlXOm7LKxrz7+HJODd0SeUVh6geBJRZQvFpEiV7X 1/nFgf9ZLG5LPLeKPdfK76vs5hzCWmvhi3ByV3saEVaOrmEu X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom Reviewed-by: Andrew Jeffery --- drivers/soc/aspeed/aspeed-lpc-snoop.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/asp= eed-lpc-snoop.c index 773dbcbc03a6..888b5840c015 100644 --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c @@ -331,7 +331,7 @@ static int aspeed_lpc_snoop_probe(struct platform_devic= e *pdev) return rc; } =20 -static int aspeed_lpc_snoop_remove(struct platform_device *pdev) +static void aspeed_lpc_snoop_remove(struct platform_device *pdev) { struct aspeed_lpc_snoop *lpc_snoop =3D dev_get_drvdata(&pdev->dev); =20 @@ -340,8 +340,6 @@ static int aspeed_lpc_snoop_remove(struct platform_devi= ce *pdev) aspeed_lpc_disable_snoop(lpc_snoop, 1); =20 clk_disable_unprepare(lpc_snoop->clk); - - return 0; } =20 static const struct aspeed_lpc_snoop_model_data ast2400_model_data =3D { @@ -368,7 +366,7 @@ static struct platform_driver aspeed_lpc_snoop_driver = =3D { .of_match_table =3D aspeed_lpc_snoop_match, }, .probe =3D aspeed_lpc_snoop_probe, - .remove =3D aspeed_lpc_snoop_remove, + .remove_new =3D aspeed_lpc_snoop_remove, }; =20 module_platform_driver(aspeed_lpc_snoop_driver); --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 B076CCE7A81 for ; Mon, 25 Sep 2023 09:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231186AbjIYJ5H (ORCPT ); Mon, 25 Sep 2023 05:57:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230292AbjIYJ4E (ORCPT ); Mon, 25 Sep 2023 05:56: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 CED94116 for ; Mon, 25 Sep 2023 02:55:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJV-0007m6-FY; Mon, 25 Sep 2023 11:55: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 1qkiJU-008pyk-BA; Mon, 25 Sep 2023 11:55:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJU-004dkX-1h; Mon, 25 Sep 2023 11:55:36 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Joel Stanley Cc: Andrew Jeffery , Rob Herring , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 03/40] soc/aspeed: aspeed-p2a-ctrl: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:54:54 +0200 Message-Id: <20230925095532.1984344-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1788; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=JYd7Sr8gyXvahOZUF55RS3qSTMWxK0yiZV2LoWrIRh4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhDt7MLlPVCMlc5EwxwPfLfsQHi2D7BV9Umr 6ddRvgar6GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYQwAKCRCPgPtYfRL+ TgKiCACIh7XmaGJyFy8+QrCBtCeZjIbj+ZtRlu3PhdmHgeaBlv0tcSXFAae4Fbnojl3pzyNZoAJ bgUabIat4hinn9Js07ibum+hfiDMqS1if6TFl59yudRcUkh+CX2clUdaktJeMpaztFi5LPirA/A O9aX0d+hE34DqXN3Ae+BoXI3BYfvy/at5Ac+cFFSIIwqor0YUgTvJEWQFTM2pahmuUItQEAZ57V G6H4lEqjPWCR6WmQTlf8sgO1gWKSIV6rF7nMY1xAgy2R45wNfamUEir65knwrtBrq7PCgUOPC17 6d+yTejyr9HU4fXdv1YmO93SCDLzMlZrdRlp0/+raxHwmiGg X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom Reviewed-by: Andrew Jeffery --- drivers/soc/aspeed/aspeed-p2a-ctrl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/aspeed/aspeed-p2a-ctrl.c b/drivers/soc/aspeed/aspe= ed-p2a-ctrl.c index 548f44da28a9..8610ddacc7bc 100644 --- a/drivers/soc/aspeed/aspeed-p2a-ctrl.c +++ b/drivers/soc/aspeed/aspeed-p2a-ctrl.c @@ -383,13 +383,11 @@ static int aspeed_p2a_ctrl_probe(struct platform_devi= ce *pdev) return rc; } =20 -static int aspeed_p2a_ctrl_remove(struct platform_device *pdev) +static void aspeed_p2a_ctrl_remove(struct platform_device *pdev) { struct aspeed_p2a_ctrl *p2a_ctrl =3D dev_get_drvdata(&pdev->dev); =20 misc_deregister(&p2a_ctrl->miscdev); - - return 0; } =20 #define SCU2C_DRAM BIT(25) @@ -433,7 +431,7 @@ static struct platform_driver aspeed_p2a_ctrl_driver = =3D { .of_match_table =3D aspeed_p2a_ctrl_match, }, .probe =3D aspeed_p2a_ctrl_probe, - .remove =3D aspeed_p2a_ctrl_remove, + .remove_new =3D aspeed_p2a_ctrl_remove, }; =20 module_platform_driver(aspeed_p2a_ctrl_driver); --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 0B178CE7A89 for ; Mon, 25 Sep 2023 09:58:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbjIYJ6H (ORCPT ); Mon, 25 Sep 2023 05:58:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230442AbjIYJ4Y (ORCPT ); Mon, 25 Sep 2023 05:56:24 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 315931B3 for ; Mon, 25 Sep 2023 02:55:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJV-0007m7-H5; Mon, 25 Sep 2023 11:55: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 1qkiJU-008pyn-IQ; Mon, 25 Sep 2023 11:55:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJU-004dkc-97; Mon, 25 Sep 2023 11:55:36 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Joel Stanley Cc: Andrew Jeffery , Arnd Bergmann , Rob Herring , Zev Weiss , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/40] soc/aspeed: aspeed-uart-routing: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:54:55 +0200 Message-Id: <20230925095532.1984344-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1943; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Dp6z+QS6f+BYha8PjTOhguNb6MQfm1ovSiqKV9hX2h4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhEDSuLBlvM8gieK9jXohUdapwIH+hiYb4hy aiG/QEwFEGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYRAAKCRCPgPtYfRL+ TlRbB/9A2LAHx8RySGAgbLbJ8MlzL2k1s7rTNPGGbJkPLkmNex9kVNnPPwajEiON0s8s7kTBAKC 1wD/b2E1kUJfaerSMsqbI0eLiRHfQZ8RrNiHt/U1/2mL1sZzE5lhb3qiVq4tfrL+KwX+hzV9Mdr sjOLm2OH6UluKyWV764xCygA01aJMnOTcCqHIZ8SaG/Vh44x755YDukvqAbcQ1ythtTxipk9+2S pbY5C/Es0/D6Vu9xNapnd2BJuqhUJdZzAz8UC89tbqnezgRBgN1cGEY7yA2lNvq1oBYb7LMIXg9 G10Ke9g15LerIWVCr6bhyew3OBir105Uex4voBQqUbQQ28M/ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom Reviewed-by: Andrew Jeffery --- drivers/soc/aspeed/aspeed-uart-routing.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/aspeed/aspeed-uart-routing.c b/drivers/soc/aspeed/= aspeed-uart-routing.c index 3a4c1f28cb34..a2195f062e01 100644 --- a/drivers/soc/aspeed/aspeed-uart-routing.c +++ b/drivers/soc/aspeed/aspeed-uart-routing.c @@ -565,14 +565,12 @@ static int aspeed_uart_routing_probe(struct platform_= device *pdev) return 0; } =20 -static int aspeed_uart_routing_remove(struct platform_device *pdev) +static void aspeed_uart_routing_remove(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; struct aspeed_uart_routing *uart_routing =3D platform_get_drvdata(pdev); =20 sysfs_remove_group(&dev->kobj, uart_routing->attr_grp); - - return 0; } =20 static const struct of_device_id aspeed_uart_routing_table[] =3D { @@ -591,7 +589,7 @@ static struct platform_driver aspeed_uart_routing_drive= r =3D { .of_match_table =3D aspeed_uart_routing_table, }, .probe =3D aspeed_uart_routing_probe, - .remove =3D aspeed_uart_routing_remove, + .remove_new =3D aspeed_uart_routing_remove, }; =20 module_platform_driver(aspeed_uart_routing_driver); --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 29BEACE7A97 for ; Mon, 25 Sep 2023 09:56:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230330AbjIYJ4F (ORCPT ); Mon, 25 Sep 2023 05:56:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229877AbjIYJzs (ORCPT ); Mon, 25 Sep 2023 05:55: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 20757C2 for ; Mon, 25 Sep 2023 02:55: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 1qkiJV-0007m8-Cv; Mon, 25 Sep 2023 11:55: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 1qkiJU-008pyq-OI; Mon, 25 Sep 2023 11:55:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJU-004dkg-FO; Mon, 25 Sep 2023 11:55:36 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Li Yang Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/40] soc/fsl: dpaa2-console: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:54:56 +0200 Message-Id: <20230925095532.1984344-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1777; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ukbBE4jqLaAnZb877ktWYcrAFTDTf2PsCWS9tyemGBY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhFHEx0VdTwDi2rACcmeVnHEypdmd2pNmHks r+lH4Ry9/2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYRQAKCRCPgPtYfRL+ TtIiCAC4R9nAgiMQjZCO/5mU/wf/nxEoTUTdqBt9lg3RdO1EreAHM8m6nzWChfYjPYnGbXHCu2F xnamcdNoXIrA8tW/PV/NM0V64iORJrkB6NzJrJuXBQMFukJhZCyFb8mnAulb0/SbErp9TR4YCKr M5ndH4LGJTuU72C5O/Ys+VdvqmbOkpK72KL7YUwJzIJ8+2Brq7Dnfs+7OMpiJKjdPGgOXOT+xd1 Zb4EqJj//MO3kK7l3JXb+ODqcAB8y6VCo6SF1S6gXgM56CWsD6X9Ir2KK5dlGewOROHZnmkUgnc F7w1Wc2uTSx8ajFcnQQo1/hMhbjQQDGVh6DCnCZ9TztZq/bU X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/fsl/dpaa2-console.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/dpaa2-console.c b/drivers/soc/fsl/dpaa2-consol= e.c index 1dca693b6b38..6dbc77db7718 100644 --- a/drivers/soc/fsl/dpaa2-console.c +++ b/drivers/soc/fsl/dpaa2-console.c @@ -300,12 +300,10 @@ static int dpaa2_console_probe(struct platform_device= *pdev) return error; } =20 -static int dpaa2_console_remove(struct platform_device *pdev) +static void dpaa2_console_remove(struct platform_device *pdev) { misc_deregister(&dpaa2_mc_console_dev); misc_deregister(&dpaa2_aiop_console_dev); - - return 0; } =20 static const struct of_device_id dpaa2_console_match_table[] =3D { @@ -322,7 +320,7 @@ static struct platform_driver dpaa2_console_driver =3D { .of_match_table =3D dpaa2_console_match_table, }, .probe =3D dpaa2_console_probe, - .remove =3D dpaa2_console_remove, + .remove_new =3D dpaa2_console_remove, }; module_platform_driver(dpaa2_console_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 99270CE7A89 for ; Mon, 25 Sep 2023 09:56:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230382AbjIYJ4O (ORCPT ); Mon, 25 Sep 2023 05:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbjIYJzt (ORCPT ); Mon, 25 Sep 2023 05:55:49 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4C85CF for ; Mon, 25 Sep 2023 02:55: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 1qkiJV-0007mB-E6; Mon, 25 Sep 2023 11:55: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 1qkiJV-008pyt-0t; Mon, 25 Sep 2023 11:55:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJU-004dkk-Lk; Mon, 25 Sep 2023 11:55:36 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Herve Codina , Qiang Zhao , Li Yang Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/40] soc/fsl: cpm: qmc: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:54:57 +0200 Message-Id: <20230925095532.1984344-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1768; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=11DQKKRaNDdVL2EcVHpkaIt5mYrztBDOwN8kCrOQm8Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhGc2+gPB6a3s2QMDqTEzqCX24U4XbprVyH1 bE9BNGO3EOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYRgAKCRCPgPtYfRL+ TsVQB/9KNrlJrk+9C1jwZeKKfZySz7G1XxaOfdMa0Zdmd16IolajvJE+RoS5Ew46sGjDAabeZRj yQE7GNW0BobiHKsUBxhtTsgAwUSP9bJ1z99lsuzD/rueJj/NCwUOPoqxDC9JK7kho4aUUjqQc9t l5gpeiN5whQMovv1gyxlQ3deWI8raxUjD7X34FXBUIbEbH5vs3IwZa4Ta1lm6OTVGHa9GRAS0Ux TgRYfmMsUaC3rHO7pLUlt+VSHOBRLAoOyS5wUEhe/cgOtzdEV59jP+LzfAtQLdxF29QtcYYVaUk VICh+6//ntJNENkfoHbLFdJT02LShKrS4z1+U0ILO5lLUfg4 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Herve Codina Acked-by: Konrad Dybcio # qcom --- drivers/soc/fsl/qe/qmc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c index b3c292c9a14e..92ec76c03965 100644 --- a/drivers/soc/fsl/qe/qmc.c +++ b/drivers/soc/fsl/qe/qmc.c @@ -1415,7 +1415,7 @@ static int qmc_probe(struct platform_device *pdev) return ret; } =20 -static int qmc_remove(struct platform_device *pdev) +static void qmc_remove(struct platform_device *pdev) { struct qmc *qmc =3D platform_get_drvdata(pdev); =20 @@ -1427,8 +1427,6 @@ static int qmc_remove(struct platform_device *pdev) =20 /* Disconnect the serial from TSA */ tsa_serial_disconnect(qmc->tsa_serial); - - return 0; } =20 static const struct of_device_id qmc_id_table[] =3D { @@ -1443,7 +1441,7 @@ static struct platform_driver qmc_driver =3D { .of_match_table =3D of_match_ptr(qmc_id_table), }, .probe =3D qmc_probe, - .remove =3D qmc_remove, + .remove_new =3D qmc_remove, }; module_platform_driver(qmc_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 71163CE7A89 for ; Mon, 25 Sep 2023 09:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230386AbjIYJ4T (ORCPT ); Mon, 25 Sep 2023 05:56:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbjIYJzt (ORCPT ); Mon, 25 Sep 2023 05:55:49 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EB56D3 for ; Mon, 25 Sep 2023 02:55:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJV-0007mR-LL; Mon, 25 Sep 2023 11:55: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 1qkiJV-008pyw-7U; Mon, 25 Sep 2023 11:55:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJU-004dko-UR; Mon, 25 Sep 2023 11:55:36 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Herve Codina , Qiang Zhao , Li Yang Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/40] soc/fsl: cpm: tsa: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:54:58 +0200 Message-Id: <20230925095532.1984344-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1726; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=eIuwBQKxvMu1FI84lx/swtTa9hFNjHXOr6M8QJPy0WA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhH9CZ2hQKgImN9WjTkQ3iRo1V+LMO8M+F0y jbaF1GCabqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYRwAKCRCPgPtYfRL+ Th7AB/4+hD7+cFdG8f9bqHr0Vm21pZY/sJ0j6fNfFD+lJSk6zY4N5qfSlbuMRHcKpUsD8+Pbjrg EK6RebOZM8bsEubYcfLNJSH9ZHwIisw7EntAnsNpjHuDc2IXXUJTd5kA6doq6IhzkgDQ7xTD6Q1 bx5dnriRfZz8B2ZERpkD9YqqVRK4V3Jpe54sSPt3TtDNVKk3+wbqQDcBjlmHjST4dSJy21/UDiT 5y4g8tcKSv4ECxtMASk8gIuMXjNCWK+YHcrwEATMaRXz73ipCx0Qbvrx8mUAwlEHV4eqQBvhyeL GtBfvB6Ahq6pCei4odfB4YG5gVmNZ5TxvKTrneUQJiZ/ftQy X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Herve Codina Acked-by: Konrad Dybcio # qcom --- drivers/soc/fsl/qe/tsa.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/qe/tsa.c b/drivers/soc/fsl/qe/tsa.c index 3646153117b3..3f9981335590 100644 --- a/drivers/soc/fsl/qe/tsa.c +++ b/drivers/soc/fsl/qe/tsa.c @@ -706,7 +706,7 @@ static int tsa_probe(struct platform_device *pdev) return 0; } =20 -static int tsa_remove(struct platform_device *pdev) +static void tsa_remove(struct platform_device *pdev) { struct tsa *tsa =3D platform_get_drvdata(pdev); int i; @@ -729,7 +729,6 @@ static int tsa_remove(struct platform_device *pdev) clk_put(tsa->tdm[i].l1rclk_clk); } } - return 0; } =20 static const struct of_device_id tsa_id_table[] =3D { @@ -744,7 +743,7 @@ static struct platform_driver tsa_driver =3D { .of_match_table =3D of_match_ptr(tsa_id_table), }, .probe =3D tsa_probe, - .remove =3D tsa_remove, + .remove_new =3D tsa_remove, }; module_platform_driver(tsa_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 4EE92CE7A89 for ; Mon, 25 Sep 2023 09:55:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbjIYJzs (ORCPT ); Mon, 25 Sep 2023 05:55:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjIYJzp (ORCPT ); Mon, 25 Sep 2023 05:55: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 5A4DAA3 for ; Mon, 25 Sep 2023 02:55: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 1qkiJV-0007n8-Ri; Mon, 25 Sep 2023 11:55: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 1qkiJV-008pyz-Ei; Mon, 25 Sep 2023 11:55:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJV-004dks-5Z; Mon, 25 Sep 2023 11:55:37 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Hitomi Hasegawa Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/40] soc/fujitsu: a64fx-diag: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:54:59 +0200 Message-Id: <20230925095532.1984344-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1878; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=saXqsLDHKnHalVQxew/MdBsH6YDXz3ImTwJq8YFGrKw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhIlQMyzfP/6okjPblsvnLY5ljbi40E89BdP TdBef3YVZSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYSAAKCRCPgPtYfRL+ TuRZB/9CAMDp4N6XKzi15yXUJ/0r+i6UjQAowApyp9OWmLwTPlhqHOLe5KtbxMmkeJpAYcOqxt+ UjEinBWWG3DXy36ZISIk9ggwuKVIQunoOXY6Cp9FH1dDUacIjWGDi4FgoIJ9c+s2Y7eD6EVxd/p bGcE4jDmYkpXwLA5I//CvB1LnXgkBAqImvd+TVqoW+OuexRkt+xF87LW71Qni39hupQi7Zq9fO8 YxkBLLxX/NqUuFb7km3fR+8l51WEXfVlLFOrWBe5DtPjHjHNbQtGV7mLC9LRGxyVUhbWGGYemCS j+g54ccFCLwqUBA+ObaRwRVKaPcAbLZts80N4Etx27+/tLRr X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/fujitsu/a64fx-diag.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fujitsu/a64fx-diag.c b/drivers/soc/fujitsu/a64fx-d= iag.c index 524fbfeb94e3..330901893577 100644 --- a/drivers/soc/fujitsu/a64fx-diag.c +++ b/drivers/soc/fujitsu/a64fx-diag.c @@ -116,7 +116,7 @@ static int a64fx_diag_probe(struct platform_device *pde= v) return 0; } =20 -static int a64fx_diag_remove(struct platform_device *pdev) +static void a64fx_diag_remove(struct platform_device *pdev) { struct a64fx_diag_priv *priv =3D platform_get_drvdata(pdev); =20 @@ -127,8 +127,6 @@ static int a64fx_diag_remove(struct platform_device *pd= ev) free_nmi(priv->irq, NULL); else free_irq(priv->irq, NULL); - - return 0; } =20 static const struct acpi_device_id a64fx_diag_acpi_match[] =3D { @@ -144,7 +142,7 @@ static struct platform_driver a64fx_diag_driver =3D { .acpi_match_table =3D ACPI_PTR(a64fx_diag_acpi_match), }, .probe =3D a64fx_diag_probe, - .remove =3D a64fx_diag_remove, + .remove_new =3D a64fx_diag_remove, }; =20 module_platform_driver(a64fx_diag_driver); --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 35343CE7A89 for ; Mon, 25 Sep 2023 09:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbjIYJzz (ORCPT ); Mon, 25 Sep 2023 05:55:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjIYJzq (ORCPT ); Mon, 25 Sep 2023 05:55:46 -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 22CD2CE for ; Mon, 25 Sep 2023 02:55: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 1qkiJW-0007nL-IL; Mon, 25 Sep 2023 11:55: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 1qkiJV-008pz8-Lt; Mon, 25 Sep 2023 11:55:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJV-004dkw-Cg; Mon, 25 Sep 2023 11:55:37 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Huisong Li Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/40] soc/hisilicon: kunpeng_hccs: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:00 +0200 Message-Id: <20230925095532.1984344-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1787; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ply7/qctArKFDggIXfdSLlnu/GsdOcRz3LcmV8XoP6g=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhK684tGxb/mAjBX0IdDbHleZ0yNFtJqs02u 9jfVpu77X6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYSgAKCRCPgPtYfRL+ TtAMB/9nctyFm3rLBo6SLcMnVXPeyBYuK/vaBuiIMyy2tRBYKlzn8cGBgkLdM2PWsGPDJMz8z9W q+uwVFYpbfrxNts67D2NOAA4wKbfFGwBAKFWO+nD7+SXC3NDuyQtxhNuSPAt/KBNaZ/FuvBtkQw 955873tg+0hatk5SIQsbUU1By2XxSeXYc/Ugs3Lk6VcHNfy7V4tJ+bJeGaSxlt9J69T9/umK6Vb n3DgPRUdlXW+AvCT/AOYjiO0gGW8FTQJ7YAeg0/GjkOnLzyVbQx7Pbx8iUHNkSrWU8f7xWFuiki i5T1kKXUF62XZhhB0Qxiu7y4AGxgxR6UarsLdDVBjOIYvZIM X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/hisilicon/kunpeng_hccs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/k= unpeng_hccs.c index f3810d9d1caa..01aec0df98ec 100644 --- a/drivers/soc/hisilicon/kunpeng_hccs.c +++ b/drivers/soc/hisilicon/kunpeng_hccs.c @@ -1244,14 +1244,12 @@ static int hccs_probe(struct platform_device *pdev) return rc; } =20 -static int hccs_remove(struct platform_device *pdev) +static void hccs_remove(struct platform_device *pdev) { struct hccs_dev *hdev =3D platform_get_drvdata(pdev); =20 hccs_remove_topo_dirs(hdev); hccs_unregister_pcc_channel(hdev); - - return 0; } =20 static const struct acpi_device_id hccs_acpi_match[] =3D { @@ -1262,7 +1260,7 @@ MODULE_DEVICE_TABLE(acpi, hccs_acpi_match); =20 static struct platform_driver hccs_driver =3D { .probe =3D hccs_probe, - .remove =3D hccs_remove, + .remove_new =3D hccs_remove, .driver =3D { .name =3D "kunpeng_hccs", .acpi_match_table =3D hccs_acpi_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 D2A35CE7A95 for ; Mon, 25 Sep 2023 09:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230021AbjIYJzw (ORCPT ); Mon, 25 Sep 2023 05:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjIYJzq (ORCPT ); Mon, 25 Sep 2023 05:55:46 -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 D01E2C2 for ; Mon, 25 Sep 2023 02:55: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 1qkiJW-0007nR-9J; Mon, 25 Sep 2023 11:55: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 1qkiJV-008pzC-SL; Mon, 25 Sep 2023 11:55:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJV-004dl0-J3; Mon, 25 Sep 2023 11:55:37 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Halasa Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 10/40] soc/ixp4xx: ixp4xx-npe: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:01 +0200 Message-Id: <20230925095532.1984344-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1795; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nCrJKabnsqX9H53lylFo464Y3PbUHfbxoonMWHYMvkE=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTBCO/tvFlXHs77uTr0SoxW0lMNdosz6b3ro1N1rmYKG 8t5TLnRyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBEQhay/xVotDtfoPXNI+8i b0roj3UGfOXXWRbeMfGoy1rOzpD0IHrelnXx+Q+Xp4iv6Kr7dSI3z6WSobYpw3eaqFpKpJ2shfh qWYVLZhrTbj6/qJbbxLSw57Danebpgd5H2YOi52bsFjVetlY2Pt6grsTmIm/Dmxr/S3cFZTnfRG 7J8DP6UJ3l6eT34SzL7nXXZz65KPqkXbk6W9jl044VbJtL1zqfbT8od2fLyZUsx7au+HQ1NG5ll sMlfs8tqwNuhoXMykw1DNaI2sPAtHWimOnhVbkyFQWCQsYtR+bZTL/OoC/zKFJfImteT4vFd615 d3lVE3/dXnTDw/l0x0HeC5IiDdp9LN/TDDcm79KSeqUBAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/ixp4xx/ixp4xx-npe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/ixp4xx/ixp4xx-npe.c b/drivers/soc/ixp4xx/ixp4xx-np= e.c index 5be9988f30ce..35825ee95dff 100644 --- a/drivers/soc/ixp4xx/ixp4xx-npe.c +++ b/drivers/soc/ixp4xx/ixp4xx-npe.c @@ -736,7 +736,7 @@ static int ixp4xx_npe_probe(struct platform_device *pde= v) return 0; } =20 -static int ixp4xx_npe_remove(struct platform_device *pdev) +static void ixp4xx_npe_remove(struct platform_device *pdev) { int i; =20 @@ -744,8 +744,6 @@ static int ixp4xx_npe_remove(struct platform_device *pd= ev) if (npe_tab[i].regs) { npe_reset(&npe_tab[i]); } - - return 0; } =20 static const struct of_device_id ixp4xx_npe_of_match[] =3D { @@ -761,7 +759,7 @@ static struct platform_driver ixp4xx_npe_driver =3D { .of_match_table =3D ixp4xx_npe_of_match, }, .probe =3D ixp4xx_npe_probe, - .remove =3D ixp4xx_npe_remove, + .remove_new =3D ixp4xx_npe_remove, }; module_platform_driver(ixp4xx_npe_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 940B0CE7A95 for ; Mon, 25 Sep 2023 09:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbjIYJz5 (ORCPT ); Mon, 25 Sep 2023 05:55:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbjIYJzq (ORCPT ); Mon, 25 Sep 2023 05:55:46 -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 EB011C6 for ; Mon, 25 Sep 2023 02:55: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 1qkiJW-0007na-Ei; Mon, 25 Sep 2023 11:55: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 1qkiJW-008pzG-2C; Mon, 25 Sep 2023 11:55:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJV-004dl4-PJ; Mon, 25 Sep 2023 11:55:37 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Halasa Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/40] soc/ixp4xx: ixp4xx-qmgr: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:02 +0200 Message-Id: <20230925095532.1984344-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1717; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=HudFbgOcgVWKgqxMtzAy+tK9o9GlSRRwK6tTBfx+JS4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhMmDxj6OX/DR/bhIvlFUD5d6B8TbKN3gQz7 EKAN2ByP9GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYTAAKCRCPgPtYfRL+ TgFYB/44oA3f0XXEXVKeBOSu5mPOcVc6nis5SiomTDO+TuP/3MPMHeLWmQ+omdc3yj6nDHwYnro Lp1nc8AmtBlXzlzkOTsAXKj/qJR6xBGZ+6lB1jZvR5pN2g6EcT3NbVOPl350D/wGi/4mmY1f4lm G8ozjN+5mkmY5g3ldYNKxVI/QyXtaazAzRd+QJ50nfwpLXc+eIVgoeXI/QonEE8185eaDHX+44+ 3LTGCTSFaMG3zbILZ0t6+hnZpluWiOrOQYHi3dHfEWbchWHi0cba1C8PjHJO4dczWPKxLKp+huA C/tu8Qaa7DEps5/HQWafKiLWkKMIhhnFl+xptdgYnE9mkLpR X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/ixp4xx/ixp4xx-qmgr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ixp4xx/ixp4xx-qmgr.c b/drivers/soc/ixp4xx/ixp4xx-q= mgr.c index 291086bb9313..244ad8d7e80b 100644 --- a/drivers/soc/ixp4xx/ixp4xx-qmgr.c +++ b/drivers/soc/ixp4xx/ixp4xx-qmgr.c @@ -442,11 +442,10 @@ static int ixp4xx_qmgr_probe(struct platform_device *= pdev) return 0; } =20 -static int ixp4xx_qmgr_remove(struct platform_device *pdev) +static void ixp4xx_qmgr_remove(struct platform_device *pdev) { synchronize_irq(qmgr_irq_1); synchronize_irq(qmgr_irq_2); - return 0; } =20 static const struct of_device_id ixp4xx_qmgr_of_match[] =3D { @@ -462,7 +461,7 @@ static struct platform_driver ixp4xx_qmgr_driver =3D { .of_match_table =3D ixp4xx_qmgr_of_match, }, .probe =3D ixp4xx_qmgr_probe, - .remove =3D ixp4xx_qmgr_remove, + .remove_new =3D ixp4xx_qmgr_remove, }; module_platform_driver(ixp4xx_qmgr_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 D33C8CE7A81 for ; Mon, 25 Sep 2023 09:55:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbjIYJ4C (ORCPT ); Mon, 25 Sep 2023 05:56:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbjIYJzr (ORCPT ); Mon, 25 Sep 2023 05:55:47 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 434CCA3 for ; Mon, 25 Sep 2023 02:55:41 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJW-0007ow-P3; Mon, 25 Sep 2023 11:55: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 1qkiJW-008pzJ-BI; Mon, 25 Sep 2023 11:55:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJW-004dl8-24; Mon, 25 Sep 2023 11:55:38 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Karol Gugala , Mateusz Holenko , Gabriel Somlo , Joel Stanley Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/40] soc/litex: litex_soc_ctrl: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:03 +0200 Message-Id: <20230925095532.1984344-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1834; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+aJKU9kQ906MNGjvm2UkK9UOq1OE6knQipDDEsBvRok=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhNqCRoX3E4tgYELpgXaTNQI0/SvvNFeLtdI b55H1R1c+iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYTQAKCRCPgPtYfRL+ Ts5KB/sGPfoH5i1nQoeV08Wpif32WBtRNbG3tWRhtvBYv8/jkPBuLyVPdFvPmarJ2uXvu++QqZQ KzOT3RBgwE21ZEZc9UfbOsLi/fT5s8kErxZth+P6ynkpTSM8jGIGM4nrdKiljcChlUa/qhCwWI8 BOjZOL85i+QXSg1nNW/Kp4b5QU1p9l3lwCA7zIbMMN8H3mFjQcTUowAYTLaTytCFMNoi/nqcvpN 7lDomFtFdeln3Y4F6LCs85QRun4zgHT9WSPtCflnI48vaVuNyBfIo4Q9yRhsfZ4mTGCTEeNrkGl DKpobOZJHu9c9e/e7KKoB2iIfBg1gNs+GcSk3lMO5nLSMS3o X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Gabriel Somlo Acked-by: Konrad Dybcio # qcom --- drivers/soc/litex/litex_soc_ctrl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/litex/litex_soc_ctrl.c b/drivers/soc/litex/litex_s= oc_ctrl.c index f75790091d38..10813299aa10 100644 --- a/drivers/soc/litex/litex_soc_ctrl.c +++ b/drivers/soc/litex/litex_soc_ctrl.c @@ -120,12 +120,11 @@ static int litex_soc_ctrl_probe(struct platform_devic= e *pdev) return 0; } =20 -static int litex_soc_ctrl_remove(struct platform_device *pdev) +static void litex_soc_ctrl_remove(struct platform_device *pdev) { struct litex_soc_ctrl_device *soc_ctrl_dev =3D platform_get_drvdata(pdev); =20 unregister_restart_handler(&soc_ctrl_dev->reset_nb); - return 0; } =20 static struct platform_driver litex_soc_ctrl_driver =3D { @@ -134,7 +133,7 @@ static struct platform_driver litex_soc_ctrl_driver =3D= { .of_match_table =3D of_match_ptr(litex_soc_ctrl_of_match) }, .probe =3D litex_soc_ctrl_probe, - .remove =3D litex_soc_ctrl_remove, + .remove_new =3D litex_soc_ctrl_remove, }; =20 module_platform_driver(litex_soc_ctrl_driver); --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 29E7DCE7A81 for ; Mon, 25 Sep 2023 09:56:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbjIYJ4h (ORCPT ); Mon, 25 Sep 2023 05:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230042AbjIYJzw (ORCPT ); Mon, 25 Sep 2023 05:55:52 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85738DA for ; Mon, 25 Sep 2023 02:55: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 1qkiJX-0007qg-M8; Mon, 25 Sep 2023 11:55: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 1qkiJW-008pzO-Io; Mon, 25 Sep 2023 11:55:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJW-004dlC-9A; Mon, 25 Sep 2023 11:55:38 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Yinbo Zhu Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 13/40] soc/loongson: loongson2_guts: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:04 +0200 Message-Id: <20230925095532.1984344-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1681; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ATjpJg3Ymn3lpV/5/BensT0YUucFb6ICE/DcTgZnEiU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhOe/DWNmRhMPdnepAPTAePH9HSED/q6ORNq y4EcfxNb7WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYTgAKCRCPgPtYfRL+ TvGmCAChX5JJSKyWxFMa7rU47aHAgL6TpgnCjq94OMFLpaki4HemK4CGcqcXzVOOpb8Ibp7vjsg MZu3h8z/Lbwpavjrwo2L1g7Tq2Tlt2fWIH+F/zX7Eu4+VpphT9vNj0Gjp+VATd8mhbXk1YXE5HJ WcqyI/lLeOVm0dks8SLNWpVBN1UsfpJZyoTB4bpO6u3wnoFNwRqE2xCfeZslzh6B16qzGa5YTi4 yGWMU5gJryc5JulBxbszxRCcsGmlxgU98i9Iy+xytb17tOj+EQR770ZaMTMV0as7ldV2u/Z0miN d6lcfMkkifrfU6ut/kQFd4TW7Hp28ZAUSeAVCNDh1zGfigWT X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/loongson/loongson2_guts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/loongson/loongson2_guts.c b/drivers/soc/loongson/l= oongson2_guts.c index bace4bc8e03b..48f8382888a7 100644 --- a/drivers/soc/loongson/loongson2_guts.c +++ b/drivers/soc/loongson/loongson2_guts.c @@ -150,11 +150,9 @@ static int loongson2_guts_probe(struct platform_device= *pdev) return 0; } =20 -static int loongson2_guts_remove(struct platform_device *dev) +static void loongson2_guts_remove(struct platform_device *dev) { soc_device_unregister(soc_dev); - - return 0; } =20 /* @@ -173,7 +171,7 @@ static struct platform_driver loongson2_guts_driver =3D= { .of_match_table =3D loongson2_guts_of_match, }, .probe =3D loongson2_guts_probe, - .remove =3D loongson2_guts_remove, + .remove_new =3D loongson2_guts_remove, }; =20 static int __init loongson2_guts_init(void) --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 38D82CE7A89 for ; Mon, 25 Sep 2023 09:56:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230091AbjIYJ4E (ORCPT ); Mon, 25 Sep 2023 05:56:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjIYJzs (ORCPT ); Mon, 25 Sep 2023 05:55: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 4B959AB for ; Mon, 25 Sep 2023 02:55: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 1qkiJX-0007sR-N0; Mon, 25 Sep 2023 11:55: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 1qkiJW-008pzS-Py; Mon, 25 Sep 2023 11:55:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJW-004dlG-Gp; Mon, 25 Sep 2023 11:55:38 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 14/40] soc/mediatek: mtk-devapc: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:05 +0200 Message-Id: <20230925095532.1984344-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1642; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4mDlQdT+SKDigR9rWkmGPnQAJhFIImIOy2rzeN86XAI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhPt6NjlVUHKAv3ujhoIKwQ5eFrE/R60mg3Z 3zLG5Nsz7+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYTwAKCRCPgPtYfRL+ TvveB/95rUhbP47NLVnmld4lik0f5Kegu9YzqCK+obwHfQCB+6WDKyQop+Ocow3WKMlEG0J5Wn5 AdXkSoHN543Zsw07iWqWq21fqAcLvOFO6iNlNWWBiDEmvfruDaIGIiam1XqZmsqwsArXMNMVHwQ Qk5wnAPEQIJKOqW37uymybCX0W9C/BrxTVSp3MXmSTUMZEg66qJ/oB962uMUPO17hM084l5lUqi QUVT20D70XL4TpxAQTgSxQpCs8Gl6fXNSpy676mUSMtLTkJ1VUx6sHC8wS79Ldbysumvr3gSlHf gFMn7W6P8smqQyIpxx47VX91SPWnOKi3VJXvbgLh6XIrAIaW X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom Reviewed-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-devapc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/mediatek/mtk-devapc.c b/drivers/soc/mediatek/mtk-d= evapc.c index b28feb967540..56cc345552a4 100644 --- a/drivers/soc/mediatek/mtk-devapc.c +++ b/drivers/soc/mediatek/mtk-devapc.c @@ -292,18 +292,16 @@ static int mtk_devapc_probe(struct platform_device *p= dev) return 0; } =20 -static int mtk_devapc_remove(struct platform_device *pdev) +static void mtk_devapc_remove(struct platform_device *pdev) { struct mtk_devapc_context *ctx =3D platform_get_drvdata(pdev); =20 stop_devapc(ctx); - - return 0; } =20 static struct platform_driver mtk_devapc_driver =3D { .probe =3D mtk_devapc_probe, - .remove =3D mtk_devapc_remove, + .remove_new =3D mtk_devapc_remove, .driver =3D { .name =3D "mtk-devapc", .of_match_table =3D mtk_devapc_dt_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 C45A7CE7A89 for ; Mon, 25 Sep 2023 09:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbjIYJ4J (ORCPT ); Mon, 25 Sep 2023 05:56:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbjIYJzt (ORCPT ); Mon, 25 Sep 2023 05:55:49 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76FB4CE for ; Mon, 25 Sep 2023 02:55: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 1qkiJY-0007uc-0l; Mon, 25 Sep 2023 11:55: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 1qkiJX-008pzW-0R; Mon, 25 Sep 2023 11:55:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJW-004dlK-NK; Mon, 25 Sep 2023 11:55:38 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Matthias Brugger Cc: AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 15/40] soc/mediatek: mtk-mmsys: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:06 +0200 Message-Id: <20230925095532.1984344-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1788; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=rYYt3hWOxp/rSaZB3hC7bdPjy5E0f9rqT7YB73IPNG0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhQ2N8vDR9nD2Ao5MCsYTZ3vLvCyUvVxxx0T Vt0oDCqWlOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYUAAKCRCPgPtYfRL+ TvwPB/4trVp3+XeXDsOKsLF2pIYXJVUcGZyiBWvSwTKMJdMg2bZm1HT6OPeQkvwpWBIZDWFKS6C W/+hvBOySWnKaGM4sIsj/Ic6J8bPxDPemgM4B7GyraS05WHPkSlyQ4vRNCMkszEoDvjWyeqqJYM jqnPDusWzeLnNmWDEKiraDEdLn17SzAMDrmUNO0DUBZzx307ekkEX9up7dTOvLZZQyKVfbH+ehr 0KkVd/fgWvTUep5mW56l4lBIMLN8nEZVxK+/E2mqxDl/mpVljsDo5NH37AvPqKPJzFfv9JSQSKM h907gt6rOgQF+DeanqWrrgnWcMujwdRHw+OLnuTmgoh4D4AM X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom Reviewed-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-mmsys.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mm= sys.c index ffb75711a1da..88209102ff3b 100644 --- a/drivers/soc/mediatek/mtk-mmsys.c +++ b/drivers/soc/mediatek/mtk-mmsys.c @@ -410,14 +410,12 @@ static int mtk_mmsys_probe(struct platform_device *pd= ev) return 0; } =20 -static int mtk_mmsys_remove(struct platform_device *pdev) +static void mtk_mmsys_remove(struct platform_device *pdev) { struct mtk_mmsys *mmsys =3D platform_get_drvdata(pdev); =20 platform_device_unregister(mmsys->drm_pdev); platform_device_unregister(mmsys->clks_pdev); - - return 0; } =20 static const struct of_device_id of_match_mtk_mmsys[] =3D { @@ -449,7 +447,7 @@ static struct platform_driver mtk_mmsys_drv =3D { .of_match_table =3D of_match_mtk_mmsys, }, .probe =3D mtk_mmsys_probe, - .remove =3D mtk_mmsys_remove, + .remove_new =3D mtk_mmsys_remove, }; module_platform_driver(mtk_mmsys_drv); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 58A8BCE7A89 for ; Mon, 25 Sep 2023 09:56:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231160AbjIYJ44 (ORCPT ); Mon, 25 Sep 2023 05:56:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbjIYJz4 (ORCPT ); Mon, 25 Sep 2023 05:55: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 A9C77106 for ; Mon, 25 Sep 2023 02:55:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJY-0007vo-4O; Mon, 25 Sep 2023 11:55: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 1qkiJX-008pzZ-76; Mon, 25 Sep 2023 11:55:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJW-004dlO-UI; Mon, 25 Sep 2023 11:55:38 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Conor Dooley , Daire McNamara Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 16/40] soc/microchip: mpfs-sys-controller: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:07 +0200 Message-Id: <20230925095532.1984344-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1915; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qMSvMdLyWMVv0eJCyiyAecwlWse+6vZrOq8DCVNTw0k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhRLmiPsKzsDJkYR+pBw2aoZnqSIdabHXV7C DpcqEXgCa2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYUQAKCRCPgPtYfRL+ TmTYB/99Y/TSuw+jf9J9wshJHpxLVPHGRUpd5pY81V4tLP2iw+PzEksAiYPeQymUzFoH1qsh1Is t/RZu7byjFUcQGsdQUHYb01thd2I/BwqgtXqnj+9f12ZgIjs7T4uvIpZsMzscvrM2Z1/sMclYZV wdhVIxGpotONKw8apwUR4kd/G8FCPI2TcopqkrjyY9Ct4lrPx14ra2v6XX2VDVxBuH8RCNM/Ux4 eRqP8T8xLhpjFcbn9JNZGJucAUxruSr0cvVjqp0poxFMXVTwr7UVF+8ZZLrWnC6oyqNUrWCyCad HSTQYlWFtRsmsaS2sIQWLy7FhEOniQGQem/769udRIwibvDm X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/microchip/mpfs-sys-controller.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/microchip/mpfs-sys-controller.c b/drivers/soc/micr= ochip/mpfs-sys-controller.c index fbcd5fd24d7c..0935e9e94172 100644 --- a/drivers/soc/microchip/mpfs-sys-controller.c +++ b/drivers/soc/microchip/mpfs-sys-controller.c @@ -149,13 +149,11 @@ static int mpfs_sys_controller_probe(struct platform_= device *pdev) return 0; } =20 -static int mpfs_sys_controller_remove(struct platform_device *pdev) +static void mpfs_sys_controller_remove(struct platform_device *pdev) { struct mpfs_sys_controller *sys_controller =3D platform_get_drvdata(pdev); =20 mpfs_sys_controller_put(sys_controller); - - return 0; } =20 static const struct of_device_id mpfs_sys_controller_of_match[] =3D { @@ -207,7 +205,7 @@ static struct platform_driver mpfs_sys_controller_drive= r =3D { .of_match_table =3D mpfs_sys_controller_of_match, }, .probe =3D mpfs_sys_controller_probe, - .remove =3D mpfs_sys_controller_remove, + .remove_new =3D mpfs_sys_controller_remove, }; module_platform_driver(mpfs_sys_controller_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 C514BCE7A98 for ; Mon, 25 Sep 2023 09:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230497AbjIYJ4k (ORCPT ); Mon, 25 Sep 2023 05:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbjIYJzx (ORCPT ); Mon, 25 Sep 2023 05:55:53 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08BC0FB for ; Mon, 25 Sep 2023 02:55: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 1qkiJZ-0007ww-A3; Mon, 25 Sep 2023 11:55: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 1qkiJX-008pzc-Er; Mon, 25 Sep 2023 11:55:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJX-004dlR-5c; Mon, 25 Sep 2023 11:55:39 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: Arnd Bergmann , zhang songyi , Lubomir Rintel , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/40] soc/pxa: ssp: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:08 +0200 Message-Id: <20230925095532.1984344-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1766; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7RMXK7o5MKcvP26bqwpTH0k5DtjEeMQoS+T8l69yDkY=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTBiODpyie7BT4bBoj6Pj3yb9LxfxLf3ZYoMxk6KuY3c YZFvr/YyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBEVgqz/y8UOHdhVtlOtwlt Va/K9v8zcBeYrvYpM12O885e1erSj5y9wuHmKqZ1rvHBG4S/VAQ1ZtywteTZeGdWnXfpyokzZ5w S/8/IbBvodSS7q8E8kDVr/Z9Xpg+jsjk/rUwSbPyooKUQqs6zunKLs4bdu/lffm54ZbunaVKi97 mlW17nZ9TPEbvT+a3y//3F/87czCwvvpS8+/iOOMmkqPmsez9Klbc+kDUyKz4gZpLHmZH1QJVNw eK7Y9zbDWpOXW31WtZq+WX2UyJmzVrapOcfa3P0O39UTZzqqqu/1vcwaAifjZAV9t6ywcPXZu60 nmhZLy2GxYIe0tVitReYvC/u+9FwLbjq4HvncqDiNAA= X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/pxa/ssp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/pxa/ssp.c b/drivers/soc/pxa/ssp.c index bd029e838241..a1e8a07f7275 100644 --- a/drivers/soc/pxa/ssp.c +++ b/drivers/soc/pxa/ssp.c @@ -176,15 +176,13 @@ static int pxa_ssp_probe(struct platform_device *pdev) return 0; } =20 -static int pxa_ssp_remove(struct platform_device *pdev) +static void pxa_ssp_remove(struct platform_device *pdev) { struct ssp_device *ssp =3D platform_get_drvdata(pdev); =20 mutex_lock(&ssp_lock); list_del(&ssp->node); mutex_unlock(&ssp_lock); - - return 0; } =20 static const struct platform_device_id ssp_id_table[] =3D { @@ -199,7 +197,7 @@ static const struct platform_device_id ssp_id_table[] = =3D { =20 static struct platform_driver pxa_ssp_driver =3D { .probe =3D pxa_ssp_probe, - .remove =3D pxa_ssp_remove, + .remove_new =3D pxa_ssp_remove, .driver =3D { .name =3D "pxa2xx-ssp", .of_match_table =3D of_match_ptr(pxa_ssp_of_ids), --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 F0926CE7A81 for ; Mon, 25 Sep 2023 09:57:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230428AbjIYJ5N (ORCPT ); Mon, 25 Sep 2023 05:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230294AbjIYJ4E (ORCPT ); Mon, 25 Sep 2023 05:56: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 7C982120 for ; Mon, 25 Sep 2023 02:55:50 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJY-0007xN-JT; Mon, 25 Sep 2023 11:55: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 1qkiJX-008pzf-Kw; Mon, 25 Sep 2023 11:55:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJX-004dlW-Bn; Mon, 25 Sep 2023 11:55:39 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 18/40] soc/qcom: icc-bwmon: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:09 +0200 Message-Id: <20230925095532.1984344-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1699; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=p7Y6ZSGoHFVnYoY5YFtM37zF1FolMcixHTRwjNtIzHc=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTBiJBJ/CGhc2LyEs3Dbh3sqbj1ycpf6/TTtmMXBZ/ZO zDU9At2MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCR6nccDH0KXNc8/1d9mMLY uVsvoCCz3STo0xFbTYdvSsfWMQrtaWfw2Ln//jReX/aAWXrirD3v77Y4ujcz+5rk5xj6uL+ZvVT 8ObNMzoboSxcimGTVSnk+hKUd5vESLVvUuYLtUsACefP2nOWnNWZeWL/7zB2Dq4btnouOf8+7yb 95T9wtxpcc7J03DlYJ5c0weHh7j6u3GNvWvD1ttRsri4J/sPw9p+i4o6r58jIG+VNNGjrSJ8qWb GnVNJpyTbbvbHr09F+cV1Pq7UU/NIXPfpvReitJaE3vj39/moufnUz5tu3fjR7+1JaVqZI2xz18 RZxd9vxL3j8lkddyg0nk8nkHZSdx3NLTcj16rP/jpc8dAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio Acked-by: Konrad Dybcio # qcom Reviewed-by: Krzysztof Kozlowski --- drivers/soc/qcom/icc-bwmon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c index adf2d523f103..656706259353 100644 --- a/drivers/soc/qcom/icc-bwmon.c +++ b/drivers/soc/qcom/icc-bwmon.c @@ -793,13 +793,11 @@ static int bwmon_probe(struct platform_device *pdev) return 0; } =20 -static int bwmon_remove(struct platform_device *pdev) +static void bwmon_remove(struct platform_device *pdev) { struct icc_bwmon *bwmon =3D platform_get_drvdata(pdev); =20 bwmon_disable(bwmon); - - return 0; } =20 static const struct icc_bwmon_data msm8998_bwmon_data =3D { @@ -862,7 +860,7 @@ MODULE_DEVICE_TABLE(of, bwmon_of_match); =20 static struct platform_driver bwmon_driver =3D { .probe =3D bwmon_probe, - .remove =3D bwmon_remove, + .remove_new =3D bwmon_remove, .driver =3D { .name =3D "qcom-bwmon", .of_match_table =3D bwmon_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 D0AE6CE7A89 for ; Mon, 25 Sep 2023 09:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231262AbjIYJ5c (ORCPT ); Mon, 25 Sep 2023 05:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbjIYJ4W (ORCPT ); Mon, 25 Sep 2023 05:56:22 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16750193 for ; Mon, 25 Sep 2023 02:55: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 1qkiJY-0007xa-P4; Mon, 25 Sep 2023 11:55: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 1qkiJX-008pzj-R4; Mon, 25 Sep 2023 11:55:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJX-004dla-I2; Mon, 25 Sep 2023 11:55:39 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 19/40] soc/qcom: llcc-qcom: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:10 +0200 Message-Id: <20230925095532.1984344-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1770; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=GR3kItzTF2lF2zXGuL6lkmNa7DVlgJ27EVeQzbqFRn0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhVilH0/uHBUcMXkElclHTtm9Sh2Mk6dGZzT 8Rh5UsxPqKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYVQAKCRCPgPtYfRL+ TrwgCACLBGz7Uj+cZ36TV3m2AxZ0+NF0u1+JbKpucDB4Yn0U6k+/+ZYgufPcvrIlCadHJJDlsb4 LpfHf2/aKVMz4iA5Ju/e6Qdrq328+QXao5d/ZSxo5gbZahpg+fwWAsdvGVM13gJGMrYyPFof2XR R79r2NT05AKYl/wyykxI7EM1F43CMA5LeC2sxLuxVMIbEd2q5erJpsUaY9IVc0O4n9nAUpFgLc7 o5QgHATSTCoPQ2q+KONMQz+ZzkUh1iQpio5DE/zoMXAEZsIvhUw5NNRXGpu1hvznbTypzDQd9PC Ow4K8o8BulKC51SANFguXad/1kze21ts4l9j7FHDing2AmeR X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/llcc-qcom.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c index feb21637ac20..2a71548d2dc9 100644 --- a/drivers/soc/qcom/llcc-qcom.c +++ b/drivers/soc/qcom/llcc-qcom.c @@ -1080,11 +1080,10 @@ static int qcom_llcc_get_cfg_index(struct platform_= device *pdev, u8 *cfg_index, return ret; } =20 -static int qcom_llcc_remove(struct platform_device *pdev) +static void qcom_llcc_remove(struct platform_device *pdev) { /* Set the global pointer to a error code to avoid referencing it */ drv_data =3D ERR_PTR(-ENODEV); - return 0; } =20 static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, u8= index, @@ -1257,7 +1256,7 @@ static struct platform_driver qcom_llcc_driver =3D { .of_match_table =3D qcom_llcc_of_match, }, .probe =3D qcom_llcc_probe, - .remove =3D qcom_llcc_remove, + .remove_new =3D qcom_llcc_remove, }; module_platform_driver(qcom_llcc_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 6C023CE7A81 for ; Mon, 25 Sep 2023 09:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231187AbjIYJ5Y (ORCPT ); Mon, 25 Sep 2023 05:57:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230387AbjIYJ4U (ORCPT ); Mon, 25 Sep 2023 05:56:20 -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 16207180 for ; Mon, 25 Sep 2023 02:55: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 1qkiJY-0007xz-UL; Mon, 25 Sep 2023 11:55: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 1qkiJY-008pzn-1H; Mon, 25 Sep 2023 11:55:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJX-004dle-OF; Mon, 25 Sep 2023 11:55:39 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/40] soc/qcom: ocmem: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:11 +0200 Message-Id: <20230925095532.1984344-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1755; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=KObOGlqJibcEwTxRmEgjOwAj9untrpQ8ilKXu7wa5hM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhWk9EthmEyuGyAcgE9Wj5Kqe8FcaAa5iY0q 7LiNSe5O7KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYVgAKCRCPgPtYfRL+ TtK9CACvJQTcafJCCwkC+MZB3DTo+1XaoOUxcUrCpou8CfjDX8a7B1fIPX24SSzqudqSUekatTd sU2Oe7wwMuvnmdwE37nKoEsU/wOTkOthAsYZUWtgf3uLOvncnfL0tjQzHT5+l20znpyTYsgBtwL d41yJj/Nxdga3J9pvwAilw2vJ0CW40xffkUTV0FC/ACYEXRdqNcJQSvgJ709bmyKpuXidPQ++2N sy2QdZBlqWqT6f+uQG7M3Yn3f8sjCI3ALVnsjde8/d1sunxI95iG4xn1S3d1qKlPetCoFX0yK+/ F3BAstM58QT/6BFPyA2t/Hw1aRWrOeiSGOU9sJQBdnvI6JQN X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/ocmem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c index 20f5461d46b9..5e9f2c1fd305 100644 --- a/drivers/soc/qcom/ocmem.c +++ b/drivers/soc/qcom/ocmem.c @@ -416,14 +416,12 @@ static int ocmem_dev_probe(struct platform_device *pd= ev) return ret; } =20 -static int ocmem_dev_remove(struct platform_device *pdev) +static void ocmem_dev_remove(struct platform_device *pdev) { struct ocmem *ocmem =3D platform_get_drvdata(pdev); =20 clk_disable_unprepare(ocmem->core_clk); clk_disable_unprepare(ocmem->iface_clk); - - return 0; } =20 static const struct ocmem_config ocmem_8226_config =3D { @@ -446,7 +444,7 @@ MODULE_DEVICE_TABLE(of, ocmem_of_match); =20 static struct platform_driver ocmem_driver =3D { .probe =3D ocmem_dev_probe, - .remove =3D ocmem_dev_remove, + .remove_new =3D ocmem_dev_remove, .driver =3D { .name =3D "ocmem", .of_match_table =3D ocmem_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 8340FCE7A81 for ; Mon, 25 Sep 2023 09:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230355AbjIYJ55 (ORCPT ); Mon, 25 Sep 2023 05:57:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbjIYJ4X (ORCPT ); Mon, 25 Sep 2023 05:56:23 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1A451B1 for ; Mon, 25 Sep 2023 02:55:53 -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 1qkiJZ-0007yW-2A; Mon, 25 Sep 2023 11:55: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 1qkiJY-008pzr-6x; Mon, 25 Sep 2023 11:55:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJX-004dlh-U4; Mon, 25 Sep 2023 11:55:39 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 21/40] soc/qcom: pmic_glink: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:12 +0200 Message-Id: <20230925095532.1984344-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1935; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=feNw6Iehxq5cpeZvKpkOslVobhCC8GM5VKPDgbn0M7s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhX2d7dAZtHLNX+a36/PvcJy1Ir7k07q9my/ snPq4zbWemJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYVwAKCRCPgPtYfRL+ TmbDB/99bFLJnBjgwDQHuW+8AkUCkuoAMGJhVgGjexCH5XFHmLS1jqaDlr0hdLKPLjlete/WmCU qU64I3t6c1lFWolBWHiE/jgasdui9vZxTbuq7JZVhVNjLh1FsdK+BqdvzjcuRE7+g7ZIrdijP9A QmPv6gjcUu3KqldNCYw462pAKPeKKZTcvkt1879piZLevRFMHf/Orv0qe8wprqziTrS7M0diFIg TnjOwN5rjE3OsgiGGQV7lLgd+HWA+Pb8K+AFrDtvxYkGBrtIv9C2dn2nIM/DdxgGBnqaMPGZsoF 750mRZ5BmdnFO4Hva3Kpk1ieLIC4clQAC2O+pOyZABfe1NdI X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/pmic_glink.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c index 61c89ddfc75b..914057331afd 100644 --- a/drivers/soc/qcom/pmic_glink.c +++ b/drivers/soc/qcom/pmic_glink.c @@ -318,7 +318,7 @@ static int pmic_glink_probe(struct platform_device *pde= v) return ret; } =20 -static int pmic_glink_remove(struct platform_device *pdev) +static void pmic_glink_remove(struct platform_device *pdev) { struct pmic_glink *pg =3D dev_get_drvdata(&pdev->dev); =20 @@ -334,8 +334,6 @@ static int pmic_glink_remove(struct platform_device *pd= ev) mutex_lock(&__pmic_glink_lock); __pmic_glink =3D NULL; mutex_unlock(&__pmic_glink_lock); - - return 0; } =20 static const unsigned long pmic_glink_sm8450_client_mask =3D BIT(PMIC_GLIN= K_CLIENT_BATT) | @@ -352,7 +350,7 @@ MODULE_DEVICE_TABLE(of, pmic_glink_of_match); =20 static struct platform_driver pmic_glink_driver =3D { .probe =3D pmic_glink_probe, - .remove =3D pmic_glink_remove, + .remove_new =3D pmic_glink_remove, .driver =3D { .name =3D "qcom_pmic_glink", .of_match_table =3D pmic_glink_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 A1413CE7A81 for ; Mon, 25 Sep 2023 09:57:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229944AbjIYJ5i (ORCPT ); Mon, 25 Sep 2023 05:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230396AbjIYJ4W (ORCPT ); Mon, 25 Sep 2023 05:56:22 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6995E19A for ; Mon, 25 Sep 2023 02:55:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJZ-0007z4-7v; Mon, 25 Sep 2023 11:55: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 1qkiJY-008pzv-E0; Mon, 25 Sep 2023 11:55:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJY-004dll-4k; Mon, 25 Sep 2023 11:55:40 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 22/40] soc/qcom: qcom_aoss: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:13 +0200 Message-Id: <20230925095532.1984344-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1739; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=T1sLDxR+kGoYzoTaFBI1Nuu59dqPzKlYkoYyT+dImvY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhYTppoFE9VnRzAm5U5zwf2Aj1+tSfVwhRr6 Gcqaa6lDnyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYWAAKCRCPgPtYfRL+ TpZKB/kBrH/g4dHqPBiq925EB/ut0fjDxv7hZauNhlFCuocP/3CcU8c61yphN0kbBfZSDDMiItC c6k6JePZql1xJ8uSvP46r36Kgck+IrGBxxklBzHGQmgJKHH/LlNgGhV91cUmKTthvgs2ZjQeCPS y68Cp3vijmBbm63mpnF4sEhxKUKoiSXbpeONvigO8n6Ktm7VD2yr5mpx6xNiOqak9t8n9+9G8QE ZW3xzp+A+cKNoq+5yzV5Cd0A/D4bwrlVX2a/K8d3VeAxB2K76UZDDPYFx7SqA2v1OOXa4298N+Q uj+b+XvLysqm0Nvj1FtnuUnl+ctXS2e84qQSmgw+yfV3VnoP X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/qcom_aoss.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c index 77f0cf126629..e6f16b0f6160 100644 --- a/drivers/soc/qcom/qcom_aoss.c +++ b/drivers/soc/qcom/qcom_aoss.c @@ -533,7 +533,7 @@ static int qmp_probe(struct platform_device *pdev) return ret; } =20 -static int qmp_remove(struct platform_device *pdev) +static void qmp_remove(struct platform_device *pdev) { struct qmp *qmp =3D platform_get_drvdata(pdev); =20 @@ -542,8 +542,6 @@ static int qmp_remove(struct platform_device *pdev) =20 qmp_close(qmp); mbox_free_channel(qmp->mbox_chan); - - return 0; } =20 static const struct of_device_id qmp_dt_match[] =3D { @@ -565,7 +563,7 @@ static struct platform_driver qmp_driver =3D { .suppress_bind_attrs =3D true, }, .probe =3D qmp_probe, - .remove =3D qmp_remove, + .remove_new =3D qmp_remove, }; module_platform_driver(qmp_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 EFE69CE7A97 for ; Mon, 25 Sep 2023 09:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231226AbjIYJ5S (ORCPT ); Mon, 25 Sep 2023 05:57:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230232AbjIYJ4D (ORCPT ); Mon, 25 Sep 2023 05:56: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 E393711B for ; Mon, 25 Sep 2023 02:55:49 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJZ-0007zo-9W; Mon, 25 Sep 2023 11:55: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 1qkiJY-008pzy-Ju; Mon, 25 Sep 2023 11:55:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJY-004dlq-As; Mon, 25 Sep 2023 11:55:40 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/40] soc/qcom: qcom_gsbi: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:14 +0200 Message-Id: <20230925095532.1984344-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1713; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=eNF+bxPsU6MJI6SmqQsGkl5fEqZP0D5rW8QkBlB+fmk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhZndudiGaALleMrA8pDLQKs2c7vBoIWBzq7 kRDztsaYDmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYWQAKCRCPgPtYfRL+ ThgjCACrSH0U+OYk1g45k77ScIibVr/T6Xrn2/Q8lfZpo2K+EnhykNeVr/ZQkH/FWaQqCdjPZz2 TjunUQGyU6D7XTQn5XTxZ/6j5P+FQpXyWpDeKppK6Jo79rjZ6NSH02m8V2m1vgyA5rfFjbHIR0b m2xxTs313W8hqOq3MJWZLpjT72QmVp9J4nNrJOmmxDUWe2pjdCfJFNzk0CN0Xavc2xenZnXPyaz GY8woJKetAqWeqvQlcwsjzqEZMHXjwWXJdwsGs+crmMvp61rkd9YCrWdz6P69O45jN6YDpM7ZW7 6AV+6FdmZPLlKOll62bzEFwTfWyfAOCNexhl3KVXBiDefXkf X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/qcom_gsbi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/qcom_gsbi.c b/drivers/soc/qcom/qcom_gsbi.c index df7907a83aa8..f04b9a324ea9 100644 --- a/drivers/soc/qcom/qcom_gsbi.c +++ b/drivers/soc/qcom/qcom_gsbi.c @@ -212,13 +212,11 @@ static int gsbi_probe(struct platform_device *pdev) return of_platform_populate(node, NULL, NULL, &pdev->dev); } =20 -static int gsbi_remove(struct platform_device *pdev) +static void gsbi_remove(struct platform_device *pdev) { struct gsbi_info *gsbi =3D platform_get_drvdata(pdev); =20 clk_disable_unprepare(gsbi->hclk); - - return 0; } =20 static const struct of_device_id gsbi_dt_match[] =3D { @@ -234,7 +232,7 @@ static struct platform_driver gsbi_driver =3D { .of_match_table =3D gsbi_dt_match, }, .probe =3D gsbi_probe, - .remove =3D gsbi_remove, + .remove_new =3D gsbi_remove, }; =20 module_platform_driver(gsbi_driver); --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 38B0ACE7A95 for ; Mon, 25 Sep 2023 09:57:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231189AbjIYJ5K (ORCPT ); Mon, 25 Sep 2023 05:57:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230300AbjIYJ4E (ORCPT ); Mon, 25 Sep 2023 05:56: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 7C78BA3 for ; Mon, 25 Sep 2023 02:55:50 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJZ-00080N-Gs; Mon, 25 Sep 2023 11:55: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 1qkiJY-008q02-Qi; Mon, 25 Sep 2023 11:55:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJY-004dlu-HQ; Mon, 25 Sep 2023 11:55:40 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 24/40] soc/qcom: qcom_stats: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:15 +0200 Message-Id: <20230925095532.1984344-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1730; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=z9fDP19zx0VBMpDk4svcAIbNux/+DzH7lIgpOOieEuk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhabXvvmA8uj9gwxN5Bih6E2DKSb+yniXcUz kUbKHroAeKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYWgAKCRCPgPtYfRL+ TptoB/9TY2KCYDK+eIBZrVgrDX5tQLexjXbFoZvHdiMXF9/0t0S/4ZCayyj9cCGLp5djqtzdM7O zpR/1fU8wJiuqOcriuilvLdpsln5MfTGw4vZnIDxG9u7bG+tCS8rE40N6jEHOy1NmotiXa5z1Bo 91hIQpmafX59c7JwHG7CNMy3rmRqXDXLociJjgkNLFviyVdQMpn/W8hrwllyAhQthFSQK9x0R35 Md2nl39i4iLDI8kOaR+ADE5Tee1VTJ8QxLyZNZfXaQBqPVYC7IZ71b0ZobhUOT/v188BTrNAB8s M9aaNxV+ilJPJXkt+N23oCA0SZbuZyNUwItdR/yQOUKtVcHk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/qcom_stats.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c index c207bb96c523..0216fc24f2ca 100644 --- a/drivers/soc/qcom/qcom_stats.c +++ b/drivers/soc/qcom/qcom_stats.c @@ -216,13 +216,11 @@ static int qcom_stats_probe(struct platform_device *p= dev) return 0; } =20 -static int qcom_stats_remove(struct platform_device *pdev) +static void qcom_stats_remove(struct platform_device *pdev) { struct dentry *root =3D platform_get_drvdata(pdev); =20 debugfs_remove_recursive(root); - - return 0; } =20 static const struct stats_config rpm_data =3D { @@ -272,7 +270,7 @@ MODULE_DEVICE_TABLE(of, qcom_stats_table); =20 static struct platform_driver qcom_stats =3D { .probe =3D qcom_stats_probe, - .remove =3D qcom_stats_remove, + .remove_new =3D qcom_stats_remove, .driver =3D { .name =3D "qcom_stats", .of_match_table =3D qcom_stats_table, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 AF6C3CE7A89 for ; Mon, 25 Sep 2023 09:57:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbjIYJ57 (ORCPT ); Mon, 25 Sep 2023 05:57:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230419AbjIYJ4X (ORCPT ); Mon, 25 Sep 2023 05:56:23 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F5BB1AD for ; Mon, 25 Sep 2023 02:55:53 -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 1qkiJZ-00080h-Po; Mon, 25 Sep 2023 11:55: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 1qkiJZ-008q07-1r; Mon, 25 Sep 2023 11:55:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJY-004dly-Ok; Mon, 25 Sep 2023 11:55:40 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/40] soc/qcom: rmtfs_mem: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:16 +0200 Message-Id: <20230925095532.1984344-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1979; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=le7eqGOuTakdhmTooKCsfZuf14WGGjNqknr7alRV/ww=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTBiJg97v/iWBJ0CxjXRAsbe0nmfbMOe31/BfsLjpVbs 5LqLqZ2MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCRxRs4GBYL7X8pZNC1p2xu oMxuy71zeqL5RWPsOyyCJexuxF0NXfv181E+R1X12hJW3lumuZf+7Vv1WFGpOcmvNnD6zEcRuUv mh1z8fSumQUuvnNVEfC2z87PrSrfK9jgq3AvpLJOrdXI+9nh2Rnswb7ihSBGH6JZE/p9uZyYd03 Wtm71Va6LXVIejfzrFwu87LLPZ5SF8zTEmX00zI1PgzL9kjqo5K9OX7zuZq/I6Z8Hvu2s1J1c/r Fk9IU/S2I/paK97++N3R8QWHaxyij/71Xr+Y3G7jiezVewMlerCt0n5G/W4HbLNqnMwmfNS7+bm wLWuKf5bebw3z8g1uWWefuZRNYtjebE0z4NlabIaMx8BAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/rmtfs_mem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c index f83811f51175..ab084b633ef0 100644 --- a/drivers/soc/qcom/rmtfs_mem.c +++ b/drivers/soc/qcom/rmtfs_mem.c @@ -281,7 +281,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device = *pdev) return ret; } =20 -static int qcom_rmtfs_mem_remove(struct platform_device *pdev) +static void qcom_rmtfs_mem_remove(struct platform_device *pdev) { struct qcom_rmtfs_mem *rmtfs_mem =3D dev_get_drvdata(&pdev->dev); struct qcom_scm_vmperm perm; @@ -296,8 +296,6 @@ static int qcom_rmtfs_mem_remove(struct platform_device= *pdev) =20 cdev_device_del(&rmtfs_mem->cdev, &rmtfs_mem->dev); put_device(&rmtfs_mem->dev); - - return 0; } =20 static const struct of_device_id qcom_rmtfs_mem_of_match[] =3D { @@ -308,7 +306,7 @@ MODULE_DEVICE_TABLE(of, qcom_rmtfs_mem_of_match); =20 static struct platform_driver qcom_rmtfs_mem_driver =3D { .probe =3D qcom_rmtfs_mem_probe, - .remove =3D qcom_rmtfs_mem_remove, + .remove_new =3D qcom_rmtfs_mem_remove, .driver =3D { .name =3D "qcom_rmtfs_mem", .of_match_table =3D qcom_rmtfs_mem_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 9C4D4CE7A81 for ; Mon, 25 Sep 2023 09:57:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230328AbjIYJ5q (ORCPT ); Mon, 25 Sep 2023 05:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230414AbjIYJ4X (ORCPT ); Mon, 25 Sep 2023 05:56:23 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4C2F19E for ; Mon, 25 Sep 2023 02:55:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJZ-00081B-TA; Mon, 25 Sep 2023 11:55: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 1qkiJZ-008q0B-B2; Mon, 25 Sep 2023 11:55:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJZ-004dm2-1c; Mon, 25 Sep 2023 11:55:41 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 26/40] soc/qcom: smem: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:17 +0200 Message-Id: <20230925095532.1984344-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1735; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=a5TsISKH80t4Mbb4GluzypfGWbzkLo6q57TgzVDictg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhdm+ZJki7j/qruXdGpi5LbIqbJfDW9hrwoV 8YLOyNg3cGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYXQAKCRCPgPtYfRL+ Trm7B/wPJSlkXPWdUmNfpQeJB1SMi+TWplU8juVmDYAeqyFK4I4xEMapC+lUuMzwotmxGee1SAN kvyYOxxEwdmu3byk+386J+ONufQWumzKlfJxGL9KDtDEgNjiXUfOJgJpf/H1tk86HLoWpodxfgq lkUj1Jrpa6wQ1pNlzpwzdAnUSiirjRX+n2GLNtcm01210AhaHa6Zdl3i7DeBtDm3bC6IJs5dAdO 5AujzYcXKKZZQ4BsDegqRMI92V4q5aknOsATlViawWMe0BRDd4n3BfhEZmZsIs4n89GzuvQsK7g LaKMBYdH1w7AR9iPlKJN3f9UYqWGxbSVCpmhN3I8v3chGcAX X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/smem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index d4a89d2bb43b..58beeaab6fb4 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -1187,14 +1187,12 @@ static int qcom_smem_probe(struct platform_device *= pdev) return 0; } =20 -static int qcom_smem_remove(struct platform_device *pdev) +static void qcom_smem_remove(struct platform_device *pdev) { platform_device_unregister(__smem->socinfo); =20 hwspin_lock_free(__smem->hwlock); __smem =3D NULL; - - return 0; } =20 static const struct of_device_id qcom_smem_of_match[] =3D { @@ -1205,7 +1203,7 @@ MODULE_DEVICE_TABLE(of, qcom_smem_of_match); =20 static struct platform_driver qcom_smem_driver =3D { .probe =3D qcom_smem_probe, - .remove =3D qcom_smem_remove, + .remove_new =3D qcom_smem_remove, .driver =3D { .name =3D "qcom-smem", .of_match_table =3D qcom_smem_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 BF8C1CE7A81 for ; Mon, 25 Sep 2023 09:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231255AbjIYJ53 (ORCPT ); Mon, 25 Sep 2023 05:57:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbjIYJ4U (ORCPT ); Mon, 25 Sep 2023 05:56:20 -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 1618A13A for ; Mon, 25 Sep 2023 02:55: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 1qkiJa-00081K-5h; Mon, 25 Sep 2023 11:55:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJZ-008q0H-HR; Mon, 25 Sep 2023 11:55:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJZ-004dm6-8N; Mon, 25 Sep 2023 11:55:41 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 27/40] soc/qcom: smp2p: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:18 +0200 Message-Id: <20230925095532.1984344-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1891; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Xs+opoIponkxHDRE3ORvSDT6IEXJd6McxyIMkPGK+D8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVheqoKnguqQNgbBYuCLhDeWAVPyN75Zdr8ZA g4zOlvqXyeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYXgAKCRCPgPtYfRL+ Tl2nB/9DgfJpqCbO4SqsCs95OR2K6HHgIzEdYgEC8EvrL2+u7ksyYaxsRkPQrbJ3Quhp9aNQr8D qXZbYrPyb58fP4w9LZe6Njol2pa4QmSeE6IAKVuv6X9NbtfsrtjivkKOtFnZPHTTINFZsXFdX6Y 4SjseFDArV0p7bd/S+kw9kuSp6eVtWYMfHmLAYswHfGwpSTBGsMcpiG0VHLijx99ljw4/NNYb3f 1HsR2er1TRL88e6toKpyhnL5fBlcCzIzB7P7sRJibrz1TfCJmh9zpdURbn4l852n6CsCrv31Ny0 lLkHnLuUQqknZYVUA00AR5tA+p2C462oS51jW48xTjOkn2lI X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/smp2p.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c index e9c8030d50ee..914b2246148f 100644 --- a/drivers/soc/qcom/smp2p.c +++ b/drivers/soc/qcom/smp2p.c @@ -660,7 +660,7 @@ static int qcom_smp2p_probe(struct platform_device *pde= v) return -EINVAL; } =20 -static int qcom_smp2p_remove(struct platform_device *pdev) +static void qcom_smp2p_remove(struct platform_device *pdev) { struct qcom_smp2p *smp2p =3D platform_get_drvdata(pdev); struct smp2p_entry *entry; @@ -676,8 +676,6 @@ static int qcom_smp2p_remove(struct platform_device *pd= ev) mbox_free_channel(smp2p->mbox_chan); =20 smp2p->out->valid_entries =3D 0; - - return 0; } =20 static const struct of_device_id qcom_smp2p_of_match[] =3D { @@ -688,7 +686,7 @@ MODULE_DEVICE_TABLE(of, qcom_smp2p_of_match); =20 static struct platform_driver qcom_smp2p_driver =3D { .probe =3D qcom_smp2p_probe, - .remove =3D qcom_smp2p_remove, + .remove_new =3D qcom_smp2p_remove, .driver =3D { .name =3D "qcom_smp2p", .of_match_table =3D qcom_smp2p_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 0FBD6CE7A89 for ; Mon, 25 Sep 2023 09:58:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbjIYJ6B (ORCPT ); Mon, 25 Sep 2023 05:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbjIYJ4X (ORCPT ); Mon, 25 Sep 2023 05:56:23 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C6D0BE for ; Mon, 25 Sep 2023 02:55:54 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJa-00081g-Bl; Mon, 25 Sep 2023 11:55:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJZ-008q0L-Ov; Mon, 25 Sep 2023 11:55:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJZ-004dmA-Fk; Mon, 25 Sep 2023 11:55:41 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/40] soc/qcom: smsm: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:19 +0200 Message-Id: <20230925095532.1984344-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1874; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=z/W3uxTlGbd0Hm50wr5opUq80z5rVkc5dSSX+BBq0wM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhfUTSzppz+UyUZkBjVYnRFg9b67hFbOM0PE CExnpBm1p2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYXwAKCRCPgPtYfRL+ Tgt0B/4uGFdEp9P4aoL87ZCyVsQBO5BPkmdjlzTW0cPdeFm3uCnMPFUD2s563FtLWPA03FeMitr uPoHOrosi72mlJSqkF0yVuL0FgxZSA3wsEjeN0NbGBdob9MPWsOIIMt/bkW+AfJ4hcfdxWWsMsv BDETeZoiEcrS5VqlQvmo0LKcGM4fCDT2h6dZJZ0e6yyGvbzfyjheDlcIhnVw0GeMQZvXJUz5gy7 7n/H/WJF7HAMYvkUP3ahNHxtrR3WwgDfBsK1O2ZpEffPjZY/xoEfjnSnxRzMcjyCV76V+yT/jLS 0CeSXV82SwKllE7eNRBlmUTlWl/CqRnGMQtNMRleLd8xLIxc X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/smsm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c index c58cfff64856..e7c7e9a640a6 100644 --- a/drivers/soc/qcom/smsm.c +++ b/drivers/soc/qcom/smsm.c @@ -613,7 +613,7 @@ static int qcom_smsm_probe(struct platform_device *pdev) return ret; } =20 -static int qcom_smsm_remove(struct platform_device *pdev) +static void qcom_smsm_remove(struct platform_device *pdev) { struct qcom_smsm *smsm =3D platform_get_drvdata(pdev); unsigned id; @@ -623,8 +623,6 @@ static int qcom_smsm_remove(struct platform_device *pde= v) irq_domain_remove(smsm->entries[id].domain); =20 qcom_smem_state_unregister(smsm->state); - - return 0; } =20 static const struct of_device_id qcom_smsm_of_match[] =3D { @@ -635,7 +633,7 @@ MODULE_DEVICE_TABLE(of, qcom_smsm_of_match); =20 static struct platform_driver qcom_smsm_driver =3D { .probe =3D qcom_smsm_probe, - .remove =3D qcom_smsm_remove, + .remove_new =3D qcom_smsm_remove, .driver =3D { .name =3D "qcom-smsm", .of_match_table =3D qcom_smsm_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 13F58CE7A81 for ; Mon, 25 Sep 2023 09:57:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230474AbjIYJ5w (ORCPT ); Mon, 25 Sep 2023 05:57:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbjIYJ4X (ORCPT ); Mon, 25 Sep 2023 05:56:23 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F6E919C for ; Mon, 25 Sep 2023 02:55:52 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJa-00082M-Do; Mon, 25 Sep 2023 11:55:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJZ-008q0P-WC; Mon, 25 Sep 2023 11:55:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJZ-004dmE-Mr; Mon, 25 Sep 2023 11:55:41 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 29/40] soc/qcom: socinfo: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:20 +0200 Message-Id: <20230925095532.1984344-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1630; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=90uOlJONh9cylIs5vvjXRa6sCUvXWA1OmhyJBs1pNUc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhg6iTi/gMVsP6JrDUpRAeFkHFSftL4SAAaA 3n+u6WR9L+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYYAAKCRCPgPtYfRL+ ThxwB/4q6F2zaDWOKrgbtmZdtPznLSspMmFtvuD7MCdqvCTYp/YcywPAIkDk++k0eXVcilqqBKK 7d3eWAjk5yLjzyVo3OvFUBcdxauLQDdZsYn+4T+WsCfS5d9WmAJojYJ9mo7NMrUejJMQ6DHOcJd Y8U5wgoa31qlBwBK1ryUbMI7CW0XdCKngadGw9WimIIL4MlebBwzNJ/ZQgc5399uy71iPlNdkQl Rz7e1k9MxdMSfwnN8J6uPlzpg7Ck2btwbDZKS5Iipkhur6pGBS+Suw4pbGyaAlMByHyAuP51l1q HdnPUtkCU8si6cnxlUyL7flM8/wwMC5Jvzvcvuijpx4GjdUw X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/qcom/socinfo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c index 2a15983d9f60..51e05bec5bfc 100644 --- a/drivers/soc/qcom/socinfo.c +++ b/drivers/soc/qcom/socinfo.c @@ -787,20 +787,18 @@ static int qcom_socinfo_probe(struct platform_device = *pdev) return 0; } =20 -static int qcom_socinfo_remove(struct platform_device *pdev) +static void qcom_socinfo_remove(struct platform_device *pdev) { struct qcom_socinfo *qs =3D platform_get_drvdata(pdev); =20 soc_device_unregister(qs->soc_dev); =20 socinfo_debugfs_exit(qs); - - return 0; } =20 static struct platform_driver qcom_socinfo_driver =3D { .probe =3D qcom_socinfo_probe, - .remove =3D qcom_socinfo_remove, + .remove_new =3D qcom_socinfo_remove, .driver =3D { .name =3D "qcom-socinfo", }, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 5BA2DCE7A95 for ; Mon, 25 Sep 2023 09:56:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbjIYJ4l (ORCPT ); Mon, 25 Sep 2023 05:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbjIYJzx (ORCPT ); Mon, 25 Sep 2023 05:55:53 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFEFAE3 for ; Mon, 25 Sep 2023 02:55: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 1qkiJa-00083B-ND; Mon, 25 Sep 2023 11:55:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJa-008q0T-64; Mon, 25 Sep 2023 11:55:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJZ-004dmI-TM; Mon, 25 Sep 2023 11:55:41 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Heiko Stuebner Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 30/40] soc/rockchip: io-domain: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:21 +0200 Message-Id: <20230925095532.1984344-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1863; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dSb9QNeIckA738H8tOK4mdlXe6+NMGUKtANgI6GyJvY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhhLmCL9V7I1ameNsoabvEahY8rsNxRFzmCZ MhyoiSvkuaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYYQAKCRCPgPtYfRL+ TqsQB/9O+lvyEqVpjhB5clMRQGvlRE2E4pIuH64H6vN9WvwD5VS8yymgO0poaWwThVyUFi+99fT U093S8k4KltHmhp1f3W6QsxW5PRVITqv1aAfgbppx3udLWVOGS0Kxddhx6IQC6B1BH0ObMYLeS+ IyUyRbRc6+6yg6g47KD97bvsnYI0v7WSsNoYgqIFq6/q1qqc9cQcXpX+52TtX14VBmjcAc+8Z09 +4iATbjiqKUDmFD46IaH6VEfdqTT3kCBNefhCFKrhSxJR1Fphp7M0lRSrxo0+rE2e65cnk/OJXo MahpxRkHCxfat45eiM6+ExAZ7EOdKL3c+6aMRulj8Mk7KaL/ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/rockchip/io-domain.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/rockchip/io-domain.c b/drivers/soc/rockchip/io-dom= ain.c index 6619256c2d11..18f809c160a7 100644 --- a/drivers/soc/rockchip/io-domain.c +++ b/drivers/soc/rockchip/io-domain.c @@ -687,7 +687,7 @@ static int rockchip_iodomain_probe(struct platform_devi= ce *pdev) return ret; } =20 -static int rockchip_iodomain_remove(struct platform_device *pdev) +static void rockchip_iodomain_remove(struct platform_device *pdev) { struct rockchip_iodomain *iod =3D platform_get_drvdata(pdev); int i; @@ -699,13 +699,11 @@ static int rockchip_iodomain_remove(struct platform_d= evice *pdev) regulator_unregister_notifier(io_supply->reg, &io_supply->nb); } - - return 0; } =20 static struct platform_driver rockchip_iodomain_driver =3D { .probe =3D rockchip_iodomain_probe, - .remove =3D rockchip_iodomain_remove, + .remove_new =3D rockchip_iodomain_remove, .driver =3D { .name =3D "rockchip-iodomain", .of_match_table =3D rockchip_iodomain_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 F224ACE7A81 for ; Mon, 25 Sep 2023 09:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231148AbjIYJ4y (ORCPT ); Mon, 25 Sep 2023 05:56:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbjIYJz4 (ORCPT ); Mon, 25 Sep 2023 05:55: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 A7DEF101 for ; Mon, 25 Sep 2023 02:55:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJa-000859-TZ; Mon, 25 Sep 2023 11:55:42 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJa-008q0X-FA; Mon, 25 Sep 2023 11:55:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJa-004dmM-5r; Mon, 25 Sep 2023 11:55:42 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 31/40] soc/samsung: exynos-chipid: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:22 +0200 Message-Id: <20230925095532.1984344-32-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1808; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5kh+y4DOQVrSyZkhWv/uw6w4/RUDtFUk39hMgcVFiI0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhiyd9rJ769lDBMAmedB3kviAVUASyQCp9/t LhMqggF/tuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYYgAKCRCPgPtYfRL+ Tg/8B/94KeKdeLgFZohjWhwnbra0fvi3MpKMsMjNUhpcd5kPIi1qsJy67sN20WFAReEnLBGMqMZ aqAl6ldk1b53Q2M3ATlr6o+JVUSh7zypA2EjalEXxZCHtfZ1FWpEPlQexHVRVwtmsQ26hHvrcRI DtGCjq9+3xNJyX8NJdou4dGOGtFmWg219SQ354karaHcN6fL96DwdljDjZtkQKnc0ZHa+C50ZAd SguGjS2vTnqeGDvd0vmPAFZ+PxNxvPtmU+T5eEmjpAOLiB4ch2ZBLCfK3z6kYiF8RQCK9hikHu0 DYJ3QM1mfBiYubDx2Lxkej4YtYn8R56ctFvTfBsTeyfJWTFm X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/samsung/exynos-chipid.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exyn= os-chipid.c index 7ba45c4aff97..3fd0f2b84dd3 100644 --- a/drivers/soc/samsung/exynos-chipid.c +++ b/drivers/soc/samsung/exynos-chipid.c @@ -158,13 +158,11 @@ static int exynos_chipid_probe(struct platform_device= *pdev) return ret; } =20 -static int exynos_chipid_remove(struct platform_device *pdev) +static void exynos_chipid_remove(struct platform_device *pdev) { struct soc_device *soc_dev =3D platform_get_drvdata(pdev); =20 soc_device_unregister(soc_dev); - - return 0; } =20 static const struct exynos_chipid_variant exynos4210_chipid_drv_data =3D { @@ -197,7 +195,7 @@ static struct platform_driver exynos_chipid_driver =3D { .of_match_table =3D exynos_chipid_of_device_ids, }, .probe =3D exynos_chipid_probe, - .remove =3D exynos_chipid_remove, + .remove_new =3D exynos_chipid_remove, }; module_platform_driver(exynos_chipid_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 9D023CE7A81 for ; Mon, 25 Sep 2023 10:00:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231213AbjIYKAF (ORCPT ); Mon, 25 Sep 2023 06:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230185AbjIYJ7f (ORCPT ); Mon, 25 Sep 2023 05:59:35 -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 4A59A127 for ; Mon, 25 Sep 2023 02:56:26 -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 1qkiJb-00087l-4p; Mon, 25 Sep 2023 11:55:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJa-008q0c-MW; Mon, 25 Sep 2023 11:55:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJa-004dmQ-DB; Mon, 25 Sep 2023 11:55:42 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Thierry Reding , Jonathan Hunter , Sumit Gupta , Shang XiaoJing , Muhammad Usama Anjum , Rob Herring Cc: Nick Alcock , Yang Yingliang , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 32/40] soc/tegra: cbb: tegra194-cbb: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:23 +0200 Message-Id: <20230925095532.1984344-33-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=2005; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fJek1nXRjVsALxbooou+SSfwuAYzMEZE4AiZBXgjDcQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhj7v6vyTqodYCq2VrRogq1Zj5wQGoIHk1ls VBTTjBoX92JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYYwAKCRCPgPtYfRL+ TjGHB/9JTRks2fQHjRlc6o9U5WRuLZL7Gm8heSS/KwtLWYOOBv3Ek2PbVFE+OQCAU6y7WCo1iq2 5XOvCatGvRTVUw3+BYcKE29vfUx7Bdb5uy90WanBBVqlM0V2oSbA6IRGlrskytwisxw9TddnSmy 6bloElouToNXDk1l3QdxBVq3Sot6K4MOvB1CqwkJIhqEsBVRa82b7vs2E0LBTFRoW/xes5Gat59 XH46DrxTc5TV+fMHgeV8oh3g7rzhf2h04+9gVXQ+hCCavmps9d+gybwddVAzkqr95PDnQz+RD6R XJA7viwK5QIe95rnstIB0lNVfUVGNcI0/Pc6FhD4ZGiMtnkL X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/tegra/cbb/tegra194-cbb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/tegra/cbb/tegra194-cbb.c b/drivers/soc/tegra/cbb/t= egra194-cbb.c index cf6886f362d3..9cbc562ae7d3 100644 --- a/drivers/soc/tegra/cbb/tegra194-cbb.c +++ b/drivers/soc/tegra/cbb/tegra194-cbb.c @@ -2293,7 +2293,7 @@ static int tegra194_cbb_probe(struct platform_device = *pdev) return tegra_cbb_register(&cbb->base); } =20 -static int tegra194_cbb_remove(struct platform_device *pdev) +static void tegra194_cbb_remove(struct platform_device *pdev) { struct tegra194_cbb *cbb =3D platform_get_drvdata(pdev); struct tegra_cbb *noc, *tmp; @@ -2311,8 +2311,6 @@ static int tegra194_cbb_remove(struct platform_device= *pdev) } =20 spin_unlock_irqrestore(&cbb_lock, flags); - - return 0; } =20 static int __maybe_unused tegra194_cbb_resume_noirq(struct device *dev) @@ -2332,7 +2330,7 @@ static const struct dev_pm_ops tegra194_cbb_pm =3D { =20 static struct platform_driver tegra194_cbb_driver =3D { .probe =3D tegra194_cbb_probe, - .remove =3D tegra194_cbb_remove, + .remove_new =3D tegra194_cbb_remove, .driver =3D { .name =3D "tegra194-cbb", .of_match_table =3D of_match_ptr(tegra194_cbb_match), --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 C34B8CE7A95 for ; Mon, 25 Sep 2023 09:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230514AbjIYJ4o (ORCPT ); Mon, 25 Sep 2023 05:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbjIYJzx (ORCPT ); Mon, 25 Sep 2023 05:55:53 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE713E8 for ; Mon, 25 Sep 2023 02:55: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 1qkiJb-00088E-Ah; Mon, 25 Sep 2023 11:55:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJa-008q0h-TZ; Mon, 25 Sep 2023 11:55:42 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJa-004dmT-KN; Mon, 25 Sep 2023 11:55:42 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Nishanth Menon , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 33/40] soc/ti: k3-ringacc: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:24 +0200 Message-Id: <20230925095532.1984344-34-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1696; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hlwfHmXrVPpoUA6HQvorzbxZ+wVHWipEdQuyoYdBV0k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhlVFfuEe2s8yzgLrMDIqb7suMbNJw8ygZ86 nDZkEJWesOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYZQAKCRCPgPtYfRL+ TpUEB/9jnSCqzUu3P1MFhGYE6gKOTj94efDqWml5vzmoAJQUEYcKuuGw75sXiVQOo2J4JRcN1IM G/0Q4ApYlUzZkqGbV3MvgrjnM9O0YIF4zWK3+rlpJ7SQT9xo/dAnZhzHmbiwgh2rn9HviFvUFJ1 v8u6Swskv5DobZsmnb02DQNreSG59l/CKndoFyOcjuGRhugM7u8TNJkSgquN9OAENQqbPQXfnPm 8D/CfD+Hzzs3kGADN86pEEWdJw2G7Pzpm8oyR8k/zXaF5GzQVqrC5DvhQmBLbw/H4q+Llgq8vxn CxjbnyIrHf1VgypDRhbGIPre/2Uh2RihkQ47ToXk4HDWrXly X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/ti/k3-ringacc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c index 148f54d9691d..fd4251d75935 100644 --- a/drivers/soc/ti/k3-ringacc.c +++ b/drivers/soc/ti/k3-ringacc.c @@ -1551,19 +1551,18 @@ static int k3_ringacc_probe(struct platform_device = *pdev) return 0; } =20 -static int k3_ringacc_remove(struct platform_device *pdev) +static void k3_ringacc_remove(struct platform_device *pdev) { struct k3_ringacc *ringacc =3D dev_get_drvdata(&pdev->dev); =20 mutex_lock(&k3_ringacc_list_lock); list_del(&ringacc->list); mutex_unlock(&k3_ringacc_list_lock); - return 0; } =20 static struct platform_driver k3_ringacc_driver =3D { .probe =3D k3_ringacc_probe, - .remove =3D k3_ringacc_remove, + .remove_new =3D k3_ringacc_remove, .driver =3D { .name =3D "k3-ringacc", .of_match_table =3D k3_ringacc_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 86F10CE7A95 for ; Mon, 25 Sep 2023 09:56:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230401AbjIYJ47 (ORCPT ); Mon, 25 Sep 2023 05:56:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbjIYJz4 (ORCPT ); Mon, 25 Sep 2023 05:55: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 A8D76103 for ; Mon, 25 Sep 2023 02:55:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJb-00088k-Ik; Mon, 25 Sep 2023 11:55:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJb-008q0l-5j; Mon, 25 Sep 2023 11:55:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJa-004dmY-SW; Mon, 25 Sep 2023 11:55:42 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Nishanth Menon , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 34/40] soc/ti: knav_dma: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:25 +0200 Message-Id: <20230925095532.1984344-35-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1792; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dh69mYFR4egmQPe5mzBDjMQ4mx/++UfHvxZ/Uiregas=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhm5EBdm/9vZUJsuOCEfsIrnQ0tb63Zgo3D5 qY3Qz1ktIWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYZgAKCRCPgPtYfRL+ TgjQCAC5JeA5F/+ij1LEKrRjIRPwuHFcPLZh7epJ7fyS/uyW/ZWnboMCmRCFDToziZTi3mu4CpT i29Yks7ZtxuYCiD8TzVK6mal/7N8AKCjEIb73yt4wGecf+PZBlAcXUio9lNiWwW0UqoRoauYgei TfkpJ5gM2s4W8TACWjnWDWTgbh+rP8Ii8Wid2s7cckVyN7F9L7V1QuxOFKw1nfe3ob1a3y+lzqI Qyib16oG7GZ/UOo/XsyAtCZXBMRmn2yJWHYslQUk+CKoRVgnsijWMyYsPZpW4mnu0yRkhxFOens 6sH36RS/3vvF5IWVv8Nut2LVqwnxuSOfU5JWiwTPrL29ZU8g X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/ti/knav_dma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c index 0fbc37cd5123..6023006685fc 100644 --- a/drivers/soc/ti/knav_dma.c +++ b/drivers/soc/ti/knav_dma.c @@ -773,7 +773,7 @@ static int knav_dma_probe(struct platform_device *pdev) return ret; } =20 -static int knav_dma_remove(struct platform_device *pdev) +static void knav_dma_remove(struct platform_device *pdev) { struct knav_dma_device *dma; =20 @@ -784,8 +784,6 @@ static int knav_dma_remove(struct platform_device *pdev) =20 pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } =20 static struct of_device_id of_match[] =3D { @@ -797,7 +795,7 @@ MODULE_DEVICE_TABLE(of, of_match); =20 static struct platform_driver knav_dma_driver =3D { .probe =3D knav_dma_probe, - .remove =3D knav_dma_remove, + .remove_new =3D knav_dma_remove, .driver =3D { .name =3D "keystone-navigator-dma", .of_match_table =3D of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 51A63CE7A81 for ; Mon, 25 Sep 2023 09:56:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229437AbjIYJ4q (ORCPT ); Mon, 25 Sep 2023 05:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230082AbjIYJzx (ORCPT ); Mon, 25 Sep 2023 05:55:53 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE81CEE for ; Mon, 25 Sep 2023 02:55: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 1qkiJb-00089p-OX; Mon, 25 Sep 2023 11:55:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJb-008q0p-Bf; Mon, 25 Sep 2023 11:55:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJb-004dmc-2d; Mon, 25 Sep 2023 11:55:43 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Nishanth Menon , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 35/40] soc/ti: knav_qmss_queue: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:26 +0200 Message-Id: <20230925095532.1984344-36-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1672; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ELrjacRF1jFpMcwr8ey7TAsP/DW/oJeKycDIVxyda94=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhnqr9134qY5AhMZPvy8V57NJDuo8ZOU/mLP 1w0Co+Fr8mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYZwAKCRCPgPtYfRL+ Tl9wB/9CrLgKUh3aLfv9rmqi4oA9p6kGTGHC9YvFvmUe234alk4BCwl6LelvR9HTQ4buVmdsS7z rdbSs0a0cZwYIMacmFbapkraOybI/PYnQjnl8bt1ks5EQZkxK0qaDuNs0nvFe9yKsre0RDI/tFG JFsOCDjHUbk7vtiTsAYF00EmQZxqcOf5ZbScVI8yljos35fmMgzNuOix0OU+t6Q6kdD28/jt6Fi hH35WsCLurbDJPLxQFZ5sYnZ2+wdGiMwvndw7D0fp5mKu8EeGI06u5CkBqvMdIaVypbaT8VVK0A X7/kmgkasWFJlecPumGAuVwVM2DZS+9oau9unc6oPe8hCuLe X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/ti/knav_qmss_queue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_qu= eue.c index 0f252c2549ba..cea791717957 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -1884,17 +1884,16 @@ static int knav_queue_probe(struct platform_device = *pdev) return ret; } =20 -static int knav_queue_remove(struct platform_device *pdev) +static void knav_queue_remove(struct platform_device *pdev) { /* TODO: Free resources */ pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - return 0; } =20 static struct platform_driver keystone_qmss_driver =3D { .probe =3D knav_queue_probe, - .remove =3D knav_queue_remove, + .remove_new =3D knav_queue_remove, .driver =3D { .name =3D "keystone-navigator-qmss", .of_match_table =3D keystone_qmss_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 8DFF6CE7A97 for ; Mon, 25 Sep 2023 09:56:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231181AbjIYJ5C (ORCPT ); Mon, 25 Sep 2023 05:57:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230166AbjIYJz5 (ORCPT ); Mon, 25 Sep 2023 05:55: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 A9D3B109 for ; Mon, 25 Sep 2023 02:55:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJb-0008AG-Vi; Mon, 25 Sep 2023 11:55:43 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJb-008q0t-Iy; Mon, 25 Sep 2023 11:55:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJb-004dmg-9u; Mon, 25 Sep 2023 11:55:43 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Nishanth Menon , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 36/40] soc/ti: pm33xx: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:27 +0200 Message-Id: <20230925095532.1984344-37-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1787; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=HJo3aWO18/wKa8knQmWwhu5R4zVuVXax0HAzXVwl9s0=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTBiIzcKIfQnIyHXcuv97WxRLPfu+ktFR3Z1jxXy2vN2 jAP7ZZORmMWBkYuBlkxRRb7xjWZVlVykZ1r/12GGcTKBDKFgYtTACayx5T9n1b5U2WuUv01oo2q vI2CgifuBlya5CTafvNIKJdTxPr1MU0K21TqmGU3TMtL0/F8KZYd+jNguSeXo8GFUo6lPjEndvN rTDp6alVf0pGbpUpXuQITPytyFB2YmpH40qKslCFeds/n6EuXVqu8VrA89KU7PsHpU+K1Gu/bfb qmV6KuMb+87MMxs0c4aGVsuwDvG/tJzPfWvny6ZP0HY+WZsh8ivz8MeKa8ZuIJLk0mmb13/ttMW K6wbObhdr+Wq56er4I6J1tVzV55pMrnme+cX82vZkyMXHL1frjX/G3OmS86JtmHdWb/Dsk42TUv 7WX+C2GWyyIaCycV3dZSsJKt+VpTVyK4x/LXA76TSou5AQ== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/ti/pm33xx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c index f04c21157904..8e983c3c4e03 100644 --- a/drivers/soc/ti/pm33xx.c +++ b/drivers/soc/ti/pm33xx.c @@ -583,7 +583,7 @@ static int am33xx_pm_probe(struct platform_device *pdev) return ret; } =20 -static int am33xx_pm_remove(struct platform_device *pdev) +static void am33xx_pm_remove(struct platform_device *pdev) { pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); @@ -594,7 +594,6 @@ static int am33xx_pm_remove(struct platform_device *pde= v) am33xx_pm_free_sram(); iounmap(rtc_base_virt); clk_put(rtc_fck); - return 0; } =20 static struct platform_driver am33xx_pm_driver =3D { @@ -602,7 +601,7 @@ static struct platform_driver am33xx_pm_driver =3D { .name =3D "pm33xx", }, .probe =3D am33xx_pm_probe, - .remove =3D am33xx_pm_remove, + .remove_new =3D am33xx_pm_remove, }; module_platform_driver(am33xx_pm_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 C6991CE7A96 for ; Mon, 25 Sep 2023 09:56:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbjIYJ4t (ORCPT ); Mon, 25 Sep 2023 05:56:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbjIYJzy (ORCPT ); Mon, 25 Sep 2023 05:55:54 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A937CFE for ; Mon, 25 Sep 2023 02:55: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 1qkiJc-0008AT-8C; Mon, 25 Sep 2023 11:55:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJb-008q0x-Rd; Mon, 25 Sep 2023 11:55:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJb-004dmk-Gk; Mon, 25 Sep 2023 11:55:43 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Nishanth Menon , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 37/40] soc/ti: pruss: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:28 +0200 Message-Id: <20230925095532.1984344-38-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1712; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=c709ql2KZbhU/Nl8vVPOXcOtp/pbM4UUu61jct04VQs=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTBiMyND1a/8WSSXy+oJMj0pyN86clHNreORvveyv9cl /7uhH5KJ6MxCwMjF4OsmCKLfeOaTKsqucjOtf8uwwxiZQKZwsDFKQATmSnJ/k/HVTDCsJ2Zf9Ms mbz+CWt7NYPNpnZc1wlNS7rqNsdUeo9itffT18sDuj3DrzsWdspdirms+DQqvuhM32kVBW0ZMdd v33fVM9xu8dO9WDXLJ2lh1gqf3gOmER3/Df3s221rqkUEJBUytxWKvvjXJvLspN1fxsL3JWr7bb 4IF+iLz5itFf9lo+nL3ikrTsulil3U25ihd3pTo0UcSyXDj9yjG2candDx1quobVV/FlDCf7ggN OGndndt9fVTxnbhqXVWn9yPrJc+yv9+655fk1vlp35O4rjQ+mKD87L3Znbp73/f/T+L/ceikrhY ox82D5fssZV9sUX106eQyLdW864JBdxWKntx/E79QWkWAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/ti/pruss.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c index f49f8492dde5..24a42e0b645c 100644 --- a/drivers/soc/ti/pruss.c +++ b/drivers/soc/ti/pruss.c @@ -565,7 +565,7 @@ static int pruss_probe(struct platform_device *pdev) return ret; } =20 -static int pruss_remove(struct platform_device *pdev) +static void pruss_remove(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; =20 @@ -573,8 +573,6 @@ static int pruss_remove(struct platform_device *pdev) =20 pm_runtime_put_sync(dev); pm_runtime_disable(dev); - - return 0; } =20 /* instance-specific driver private data */ @@ -610,7 +608,7 @@ static struct platform_driver pruss_driver =3D { .of_match_table =3D pruss_of_match, }, .probe =3D pruss_probe, - .remove =3D pruss_remove, + .remove_new =3D pruss_remove, }; module_platform_driver(pruss_driver); =20 --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 47737CE7A89 for ; Mon, 25 Sep 2023 09:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbjIYJ5V (ORCPT ); Mon, 25 Sep 2023 05:57:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbjIYJ4E (ORCPT ); Mon, 25 Sep 2023 05:56: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 7F324121 for ; Mon, 25 Sep 2023 02:55:50 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJc-0008Ac-Ef; Mon, 25 Sep 2023 11:55:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJc-008q11-1g; Mon, 25 Sep 2023 11:55:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJb-004dmo-Os; Mon, 25 Sep 2023 11:55:43 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Nishanth Menon , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 38/40] soc/ti: smartreflex: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:29 +0200 Message-Id: <20230925095532.1984344-39-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1895; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4d422s6IfK+PZd49xO16KIpO0P7Pb3ZoYCNlxGHe6UU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhqi4q+YX2/ODz50t5a28eJtr2XsnuzvYPbP DbLVwZkIoaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYagAKCRCPgPtYfRL+ TnvhB/9W+/ztDY/B6mFgKPRJGOLWPay5fz2LE+GwCJwYG3J+xWdj3UHzQ7CoOdzms8DROx2+OOv 7HBEsORfaLju3D+s0fk4eriQzpt6IF4tJ5gd7WPMwg1hzV91tXDZ/sUP36U5hXZgslSrWjAqr0G aGtXkA0O5XXpgZEXDtFs43B3FYypbG+11R7ZiToT+OELuJUbnuJNTywcHPimwT8dEXf6RdnRRUV VBwiwpzFkQdSEin4w1L9CrBck5ST1PQJ7EYguG1BkbLmVWkf1FPTIG3sbysqEyo/w2klJL8/TPw 6kLJR0m1jq5LiLk21/fKqs8Z0BpQDhMthlhA3qrjKFuMFaD/ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/ti/smartreflex.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/smartreflex.c b/drivers/soc/ti/smartreflex.c index 62b2f1464e46..d6219060b616 100644 --- a/drivers/soc/ti/smartreflex.c +++ b/drivers/soc/ti/smartreflex.c @@ -933,7 +933,7 @@ static int omap_sr_probe(struct platform_device *pdev) return ret; } =20 -static int omap_sr_remove(struct platform_device *pdev) +static void omap_sr_remove(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; struct omap_sr *sr_info =3D platform_get_drvdata(pdev); @@ -945,7 +945,6 @@ static int omap_sr_remove(struct platform_device *pdev) pm_runtime_disable(dev); clk_unprepare(sr_info->fck); list_del(&sr_info->node); - return 0; } =20 static void omap_sr_shutdown(struct platform_device *pdev) @@ -970,7 +969,7 @@ MODULE_DEVICE_TABLE(of, omap_sr_match); =20 static struct platform_driver smartreflex_driver =3D { .probe =3D omap_sr_probe, - .remove =3D omap_sr_remove, + .remove_new =3D omap_sr_remove, .shutdown =3D omap_sr_shutdown, .driver =3D { .name =3D DRIVER_NAME, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 36BFECE7A89 for ; Mon, 25 Sep 2023 09:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231137AbjIYJ4w (ORCPT ); Mon, 25 Sep 2023 05:56:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjIYJzz (ORCPT ); Mon, 25 Sep 2023 05:55:55 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DDDD100 for ; Mon, 25 Sep 2023 02:55:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJc-0008Ar-NY; Mon, 25 Sep 2023 11:55:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJc-008q15-Ap; Mon, 25 Sep 2023 11:55:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJc-004dms-1k; Mon, 25 Sep 2023 11:55:44 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Nishanth Menon , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 39/40] soc/ti: wkup_m3_ipc: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:30 +0200 Message-Id: <20230925095532.1984344-40-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1865; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uKW31zoDaSRnidHyxwgUspOOB3QVRh8Uu/IMjh6/dVw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhreqDzPwrtv2WQm2i+IxS/5UArlWfx0Rx+z c0iw41zTrGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYawAKCRCPgPtYfRL+ Tgj7B/sEJhCf+1WQJSVdnoeJx+FmTbUzIRWuDSgAgygIwuy13zVj7Ku/cIffjU3ntQqe4ybLY+3 oU4/yc7ndjFJ+5zLPHhetU84byJyVn7RArFqSKG9OdOTWP3YXELqmaQYmO7MZMMNo2ttNAoLsox ILAZEc4X/eUWLJ3voeH0ICDFS8xrPh9Kb7EwWZWZ2slwFMxh9DFW4kLF/H4WITAm/ezT8TglhxY IzuSMW1NCA3IRIilWP04/MPRZ/kSWpzzItf9r4jFtqGEAsPsyYG5ct8xPlhIFjBHZ7AcSaGKF1x dQdTNWpzC8dUmqKbNSAB/5qIV2xFv/ouz8ZyzCWyj4N1PWdv X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/ti/wkup_m3_ipc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c index 3aff106fc11a..6a1c6b34c414 100644 --- a/drivers/soc/ti/wkup_m3_ipc.c +++ b/drivers/soc/ti/wkup_m3_ipc.c @@ -713,7 +713,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pd= ev) return ret; } =20 -static int wkup_m3_ipc_remove(struct platform_device *pdev) +static void wkup_m3_ipc_remove(struct platform_device *pdev) { wkup_m3_ipc_dbg_destroy(m3_ipc_state); =20 @@ -723,8 +723,6 @@ static int wkup_m3_ipc_remove(struct platform_device *p= dev) rproc_put(m3_ipc_state->rproc); =20 m3_ipc_state =3D NULL; - - return 0; } =20 static int __maybe_unused wkup_m3_ipc_suspend(struct device *dev) @@ -760,7 +758,7 @@ MODULE_DEVICE_TABLE(of, wkup_m3_ipc_of_match); =20 static struct platform_driver wkup_m3_ipc_driver =3D { .probe =3D wkup_m3_ipc_probe, - .remove =3D wkup_m3_ipc_remove, + .remove_new =3D wkup_m3_ipc_remove, .driver =3D { .name =3D "wkup_m3_ipc", .of_match_table =3D wkup_m3_ipc_of_match, --=20 2.40.1 From nobody Thu Nov 14 05:23:32 2024 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 67481CE7A81 for ; Mon, 25 Sep 2023 09:58:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231343AbjIYJ6J (ORCPT ); Mon, 25 Sep 2023 05:58:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbjIYJ4i (ORCPT ); Mon, 25 Sep 2023 05:56:38 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C043CDA for ; Mon, 25 Sep 2023 02:55:58 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkiJc-0008BC-Vh; Mon, 25 Sep 2023 11:55:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qkiJc-008q1A-I2; Mon, 25 Sep 2023 11:55:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qkiJc-004dmw-8x; Mon, 25 Sep 2023 11:55:44 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Michal Simek Cc: Rob Herring , Ruan Jinjie , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 40/40] soc/xilinx: zynqmp_power: Convert to platform remove callback returning void Date: Mon, 25 Sep 2023 11:55:31 +0200 Message-Id: <20230925095532.1984344-41-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> References: <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1887; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=gIpZ9diDZeuFvzB/S1auBzLsV7kwS6CbiHArr/4Amqs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlEVhsmBIFeF96e2ej5WPmcUERrhYQkPD1S8gZD 6zHN1isOjOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZRFYbAAKCRCPgPtYfRL+ TnImCACr+IZ5Ex28v9coHdnTaCVbz+D3NZEWm/YoHQ01dIkmhaUZcckq+JW1+w/fYuSaj87sE6o 4wkYX9zAKfqjWkZd1Ho6ObugY+5YFaWgn8qQ8Q6E5TDBBTM0cX6T5fTabMn8qiN1/9GgUahMJ0F xgyTLuuW2iTZfy1INrCYaMRs24qz+v5XnjuOk4Amwh5uvHb42mC8sx92Z1x5EgE+rtGM4NnKAzj IPAZBNlkNk1ikPUhz0NIdTAvWa4QzxVKm3+DAiy0fwKE+EVDjWeXu+rlR5OhBamynhnguxIroxf bmL4YRnPEGFnLEYS/o1zEZC6kvM4gXZJkvfU3DBjEXG0rgWX X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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=C3=B6nig Acked-by: Konrad Dybcio # qcom --- drivers/soc/xilinx/zynqmp_power.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_= power.c index c2c819701eec..9d27f850f491 100644 --- a/drivers/soc/xilinx/zynqmp_power.c +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -275,7 +275,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev) return 0; } =20 -static int zynqmp_pm_remove(struct platform_device *pdev) +static void zynqmp_pm_remove(struct platform_device *pdev) { sysfs_remove_file(&pdev->dev.kobj, &dev_attr_suspend_mode.attr); if (event_registered) @@ -283,8 +283,6 @@ static int zynqmp_pm_remove(struct platform_device *pde= v) =20 if (!rx_chan) mbox_free_channel(rx_chan); - - return 0; } =20 static const struct of_device_id pm_of_match[] =3D { @@ -295,7 +293,7 @@ MODULE_DEVICE_TABLE(of, pm_of_match); =20 static struct platform_driver zynqmp_pm_platform_driver =3D { .probe =3D zynqmp_pm_probe, - .remove =3D zynqmp_pm_remove, + .remove_new =3D zynqmp_pm_remove, .driver =3D { .name =3D "zynqmp_power", .of_match_table =3D pm_of_match, --=20 2.40.1