From patchwork Mon Sep 25 09:54:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 1839001 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RvJDv44M3z1ynX for ; Mon, 25 Sep 2023 19:56:47 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RvJDv2lDYz3dWL for ; Mon, 25 Sep 2023 19:56:47 +1000 (AEST) X-Original-To: linux-aspeed@lists.ozlabs.org Delivered-To: linux-aspeed@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=pengutronix.de (client-ip=2a0a:edc0:2:b01:1d::104; helo=metis.whiteo.stw.pengutronix.de; envelope-from=ukl@pengutronix.de; receiver=lists.ozlabs.org) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RvJCj6pNmz3c3P for ; Mon, 25 Sep 2023 19:55:45 +1000 (AEST) 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_Kleine-K=C3=B6nig?= To: Joel Stanley 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 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 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-aspeed@lists.ozlabs.org X-BeenThere: linux-aspeed@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux ASPEED SoC development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@pengutronix.de, linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Errors-To: linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linux-aspeed" The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: 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/aspeed-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_device *pdev) return rc; } -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 = dev_get_drvdata(&pdev->dev); misc_deregister(&lpc_ctrl->miscdev); clk_disable_unprepare(lpc_ctrl->clk); - - return 0; } static const struct of_device_id aspeed_lpc_ctrl_match[] = { @@ -355,7 +353,7 @@ static struct platform_driver aspeed_lpc_ctrl_driver = { .of_match_table = aspeed_lpc_ctrl_match, }, .probe = aspeed_lpc_ctrl_probe, - .remove = aspeed_lpc_ctrl_remove, + .remove_new = aspeed_lpc_ctrl_remove, }; module_platform_driver(aspeed_lpc_ctrl_driver); From patchwork Mon Sep 25 09:54:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 1839003 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RvJFS0cyDz1ynX for ; Mon, 25 Sep 2023 19:57:15 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RvJFR5L96z3dDM for ; Mon, 25 Sep 2023 19:57:15 +1000 (AEST) X-Original-To: linux-aspeed@lists.ozlabs.org Delivered-To: linux-aspeed@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=pengutronix.de (client-ip=2a0a:edc0:2:b01:1d::104; helo=metis.whiteo.stw.pengutronix.de; envelope-from=ukl@pengutronix.de; receiver=lists.ozlabs.org) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RvJCm5qfgz3c3r for ; Mon, 25 Sep 2023 19:55:48 +1000 (AEST) 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_Kleine-K=C3=B6nig?= To: Joel Stanley 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 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 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-aspeed@lists.ozlabs.org X-BeenThere: linux-aspeed@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux ASPEED SoC development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Arnd Bergmann , linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Errors-To: linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linux-aspeed" The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: 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/aspeed-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_device *pdev) return rc; } -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 = dev_get_drvdata(&pdev->dev); @@ -340,8 +340,6 @@ static int aspeed_lpc_snoop_remove(struct platform_device *pdev) aspeed_lpc_disable_snoop(lpc_snoop, 1); clk_disable_unprepare(lpc_snoop->clk); - - return 0; } static const struct aspeed_lpc_snoop_model_data ast2400_model_data = { @@ -368,7 +366,7 @@ static struct platform_driver aspeed_lpc_snoop_driver = { .of_match_table = aspeed_lpc_snoop_match, }, .probe = aspeed_lpc_snoop_probe, - .remove = aspeed_lpc_snoop_remove, + .remove_new = aspeed_lpc_snoop_remove, }; module_platform_driver(aspeed_lpc_snoop_driver); From patchwork Mon Sep 25 09:54:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 1839004 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RvJFV2lz4z1ynX for ; Mon, 25 Sep 2023 19:57:18 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RvJFV232nz3dG2 for ; Mon, 25 Sep 2023 19:57:18 +1000 (AEST) X-Original-To: linux-aspeed@lists.ozlabs.org Delivered-To: linux-aspeed@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=pengutronix.de (client-ip=2a0a:edc0:2:b01:1d::104; helo=metis.whiteo.stw.pengutronix.de; envelope-from=ukl@pengutronix.de; receiver=lists.ozlabs.org) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RvJCn03PTz3c3r for ; Mon, 25 Sep 2023 19:55:49 +1000 (AEST) 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_Kleine-K=C3=B6nig?= To: Joel Stanley 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 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 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-aspeed@lists.ozlabs.org X-BeenThere: linux-aspeed@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux ASPEED SoC development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Arnd Bergmann , linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Errors-To: linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linux-aspeed" The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: 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/aspeed-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_device *pdev) return rc; } -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 = dev_get_drvdata(&pdev->dev); misc_deregister(&p2a_ctrl->miscdev); - - return 0; } #define SCU2C_DRAM BIT(25) @@ -433,7 +431,7 @@ static struct platform_driver aspeed_p2a_ctrl_driver = { .of_match_table = aspeed_p2a_ctrl_match, }, .probe = aspeed_p2a_ctrl_probe, - .remove = aspeed_p2a_ctrl_remove, + .remove_new = aspeed_p2a_ctrl_remove, }; module_platform_driver(aspeed_p2a_ctrl_driver); From patchwork Mon Sep 25 09:54:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 1839005 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RvJFj3YHsz1ynX for ; Mon, 25 Sep 2023 19:57:29 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RvJFj2rqqz3dG5 for ; Mon, 25 Sep 2023 19:57:29 +1000 (AEST) X-Original-To: linux-aspeed@lists.ozlabs.org Delivered-To: linux-aspeed@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=pengutronix.de (client-ip=2a0a:edc0:2:b01:1d::104; helo=metis.whiteo.stw.pengutronix.de; envelope-from=ukl@pengutronix.de; receiver=lists.ozlabs.org) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RvJCs4yy5z3cSg for ; Mon, 25 Sep 2023 19:55:53 +1000 (AEST) 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_Kleine-K=C3=B6nig?= To: Joel Stanley 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 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 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-aspeed@lists.ozlabs.org X-BeenThere: linux-aspeed@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux ASPEED SoC development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Zev Weiss , linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, Arnd Bergmann , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Errors-To: linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linux-aspeed" The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: 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; } -static int aspeed_uart_routing_remove(struct platform_device *pdev) +static void aspeed_uart_routing_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct aspeed_uart_routing *uart_routing = platform_get_drvdata(pdev); sysfs_remove_group(&dev->kobj, uart_routing->attr_grp); - - return 0; } static const struct of_device_id aspeed_uart_routing_table[] = { @@ -591,7 +589,7 @@ static struct platform_driver aspeed_uart_routing_driver = { .of_match_table = aspeed_uart_routing_table, }, .probe = aspeed_uart_routing_probe, - .remove = aspeed_uart_routing_remove, + .remove_new = aspeed_uart_routing_remove, }; module_platform_driver(aspeed_uart_routing_driver);