From patchwork Mon Nov 6 17:17:10 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: 13447208 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1216C4332F for ; Mon, 6 Nov 2023 17:18:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8YarXwdpxFezx8Ffkh3HLLGnG/O75vqSmT2SXfjoRPI=; b=QA6sRbir7ePfbz 7Vp2Thhv7CfpreyiyVsvHcbMEmjL6YcxLpFX4KnYcJT5+15u8JPm9YS30xs5u2X0PlOJr2Of4Tu50 mzvdSKF3ld5kUvStS1Sz/GzYCkN4dfxER/5F04rFTGrn3QGVUJnYmBV9IVA+Fbou4JblTdu/rdvvc MdNLGvy8mwAyUyCRma9QTki4qF6gIm1ai95sUq/0UjTfnXPHxM1SlHLPH+VnzJLXowqAn8CY04Dz+ JUiHhwM795la9tSEwmZ86XNuPiXJ23Wbi/2/8XqQZqK53KO6VJVib3Jqql9d4H8WAsGx46O194rZL uvr5rHNdY0ejMH6Ob0dQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r03EZ-00HCsu-2u; Mon, 06 Nov 2023 17:17:55 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r03EX-00HCrr-0v for linux-arm-kernel@lists.infradead.org; Mon, 06 Nov 2023 17:17:54 +0000 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 1r03ER-0005QR-Rp; Mon, 06 Nov 2023 18:17:47 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r03ER-0075yG-DT; Mon, 06 Nov 2023 18:17:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r03ER-00DrIl-4a; Mon, 06 Nov 2023 18:17:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Lee Jones Cc: Linus Walleij , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 01/18] mfd: ab8500-sysctrl: Convert to platform remove callback returning void Date: Mon, 6 Nov 2023 18:17:10 +0100 Message-ID: <20231106171708.3892347-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> References: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1753; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=G9tFUcuEzuvk0w58W65pOY1QPipGZgQ5PU8WRZxxC9A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSR+VNEgaAlTyT0pT8tdEH4LhVux0vD7Eg2a/O QQcKNHH+YSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUkflQAKCRCPgPtYfRL+ TrogB/sHSz9TFWQv3WhFjXxCn9WZ90BIc3UKCaxoJtFYadj3u/VsmRkJV3dDY66i6e/xyIC1Msw PlfHP3D2becfj8NhsxtttjOb4vJpnozrNywMYUr/QDUvA0fD2GCNy6tqdP2r5LvVm/J2Wc/ub4K nPFZ+lHv+lNNCLyotEWN/LfLFJDY4wW4MCKIxj+JeZGMpZzEaNA0f4zDKcQJobo4WcsmLYJbhw0 BHDRbra6/gAUaWjMlrKNrdxNMjaA2p2YBy5k5XKAepEMkRtz/Ylltoy7dD9TdXkmgYoEbTkLOQn Y8zNJzG8lhiwlTPz72f+OVI9r6PKW6CkuO38k9kE7ol7vizB 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231106_091753_326810_CD9093D9 X-CRM114-Status: GOOD ( 17.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Linus Walleij --- drivers/mfd/ab8500-sysctrl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c index eeeb62415f53..ce81fcb785d0 100644 --- a/drivers/mfd/ab8500-sysctrl.c +++ b/drivers/mfd/ab8500-sysctrl.c @@ -140,14 +140,12 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev) return 0; } -static int ab8500_sysctrl_remove(struct platform_device *pdev) +static void ab8500_sysctrl_remove(struct platform_device *pdev) { sysctrl_dev = NULL; if (pm_power_off == ab8500_power_off) pm_power_off = NULL; - - return 0; } static const struct of_device_id ab8500_sysctrl_match[] = { @@ -161,7 +159,7 @@ static struct platform_driver ab8500_sysctrl_driver = { .of_match_table = ab8500_sysctrl_match, }, .probe = ab8500_sysctrl_probe, - .remove = ab8500_sysctrl_remove, + .remove_new = ab8500_sysctrl_remove, }; static int __init ab8500_sysctrl_init(void) From patchwork Mon Nov 6 17:17:12 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: 13447209 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E8101C4332F for ; Mon, 6 Nov 2023 17:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=st0QdQv5+jMoPAY20rkHVjTGngOiwlTFgFdCQwopaa4=; b=YRLuZ79IffKS8y u4yngx1WB1yyXttAxgr40BqnYGTx+x/6VJWKtoefqKurXCJWFRaNBflT7himT2WrO3WhGEwptjNVB KsdpPxpsxIcvJXYcZLNRM7lMGx03Fa0SCA9C9Vt0Q1DKes8kBqrYMY3d8VphpdjuyW+tlzXcrSWgB OC6ZpAU9/K3BSV+uL/2AAw2JiipFZNkQ5mBX5hH3NawDRag5kr+BsXX6zeEwE7LcThdiz3xvYa8j0 L7oOJqKENgXIKsnnUECXOPGUY/vw71sxlHHk0SMcWg62UTN+81NvDjsVnYkn8uTbk/NH0gQ8ayDne lYMxxIsE03EGCgc67tXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r03Ee-00HCvO-0e; Mon, 06 Nov 2023 17:18:00 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r03Ea-00HCsy-2X for linux-arm-kernel@lists.infradead.org; Mon, 06 Nov 2023 17:17:58 +0000 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 1r03EU-0005Qd-JR; Mon, 06 Nov 2023 18:17:50 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r03ER-0075yO-Ra; Mon, 06 Nov 2023 18:17:47 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r03ER-00DrIt-IZ; Mon, 06 Nov 2023 18:17:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Lee Jones Cc: Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 03/18] mfd: exynos-lpass: Convert to platform remove callback returning void Date: Mon, 6 Nov 2023 18:17:12 +0100 Message-ID: <20231106171708.3892347-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> References: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1928; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hnM9lEd75w6pk/CQsI0uo+SpHXcPuNXW4NABO1kOboo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSR+XqyjvQ43nqvF9ocHlWxZZXet54OMT5aOkA uSKIuL0GwGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUkflwAKCRCPgPtYfRL+ ThQwB/4iWr4HdM0ot+aMfRW1+FN5fav/zZRDeq45wSEqGYaNj4zS7HZopK2CJ3gS7rU8J9j3VMy jR/fs4eqg1KzU/+zCswLGUOEtHFDw3eJu82wTkx+KFjSTI36fR2HsavHNkwlS1IDDm4Ypu3h5xQ EpYIVvxz+3zhJkTwwoIzVEi4aEk0Wu7qN4SrN1Q1B4nciVO5ZDHs4S9yxGUzToHAnYC7bQYkZdX Kyj8bCB1yWrNBd1rb3hqLYmwErZ76YdYWWQkk/X+bPttUZ5xczuM9VJ6nwj0ATWbyPm8zc2UkiU 2XZeYVM6ChkrZo89CmyouqjEHqwzwVAPGAOc5Kc6zcqAr4mu 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231106_091756_825760_02EBA6C7 X-CRM114-Status: GOOD ( 16.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/mfd/exynos-lpass.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/exynos-lpass.c b/drivers/mfd/exynos-lpass.c index 1506d8d352b1..e58990c85ed8 100644 --- a/drivers/mfd/exynos-lpass.c +++ b/drivers/mfd/exynos-lpass.c @@ -137,7 +137,7 @@ static int exynos_lpass_probe(struct platform_device *pdev) return devm_of_platform_populate(dev); } -static int exynos_lpass_remove(struct platform_device *pdev) +static void exynos_lpass_remove(struct platform_device *pdev) { struct exynos_lpass *lpass = platform_get_drvdata(pdev); @@ -146,8 +146,6 @@ static int exynos_lpass_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) exynos_lpass_disable(lpass); regmap_exit(lpass->top); - - return 0; } static int __maybe_unused exynos_lpass_suspend(struct device *dev) @@ -187,7 +185,7 @@ static struct platform_driver exynos_lpass_driver = { .of_match_table = exynos_lpass_of_match, }, .probe = exynos_lpass_probe, - .remove = exynos_lpass_remove, + .remove_new = exynos_lpass_remove, }; module_platform_driver(exynos_lpass_driver); From patchwork Mon Nov 6 17:17:13 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: 13447213 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40F64C4332F for ; Mon, 6 Nov 2023 17:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RIZ/LxAjknj6yJdMRIif43Ad6mC2EfB/rQkX1oTzxjM=; b=Z8mtd5wBaovSCJ l6DBfDsVXEBqCX3V9dXe1PKqYlhvubZCiYPdOhhymzBZMkkVjXCSYp54QxjofeLS67gjcG1m+As8V SvjOtci1l5IyY3qvBWpZ5jhyjRt/PU5JcyXkvTObiFtExN6SxHzgx0WLwPbBHpxhGQm9AXuu3JHJs jdwaMeDbjCt3CGKqnEzP9/F1P0irMOlSySB0RCWJkd0nrfVT+Gxkw7Jy26uWYeAFaVylSG0MBDzj/ bvJ5QIVeGMC/9ec6YbYvQGltdXZA6aREfu6GlxzLibGkJ7KN6knQh2nZTbe3fDYxyMQvXrWba2ftB gEcGzUcE8NC4372D5Zlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r03Eh-00HCy3-2h; Mon, 06 Nov 2023 17:18:03 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r03Ec-00HCuR-2f for linux-arm-kernel@lists.infradead.org; Mon, 06 Nov 2023 17:18:00 +0000 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 1r03ES-0005Qm-N4; Mon, 06 Nov 2023 18:17:48 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r03ES-0075yS-1K; Mon, 06 Nov 2023 18:17:48 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r03ER-00DrIw-OU; Mon, 06 Nov 2023 18:17:47 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Lee Jones Cc: Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 04/18] mfd: fsl-imx25-tsadc: Convert to platform remove callback returning void Date: Mon, 6 Nov 2023 18:17:13 +0100 Message-ID: <20231106171708.3892347-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> References: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1657; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=H9E4DQumuJYM4xGNsjymKWQwrBqvaE1jdcSqA7stR1c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSR+ZgC8CiN4AXw68Xac7xLAtjysLjM58AGsxa S96l3uwAxGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUkfmQAKCRCPgPtYfRL+ Tl7uCACZeoO2FEY4iUYohaHg2mVNmzCP4WapV70NlX8kXAT2Tp3dnW2heYmHB0Xvs//d3PC/z3c kABz4Psu0JWJJSNInbAk24uP2qBNa/vhOpfv0sF2WXHR+y6OLgo8LB2hLhfOt1EUx9O9D9Vmk7q Ak2kO9ExxuhqTkzUTQQKjR4IGQmEuvWJMY4+hrrBuNZRCtefBAPBGX/HzZDIlmkxz9MMPl4RLTT WISfBnEUuoUDiI43PqV60g75vYrN26JYRxz3gCQL3WIiS3ISBfiQhWtkiZN7kUKQKcYqf0dJpT7 4y991Gk4gxKVTjPoKF+yOy7iYRnK+fjtv19N50aZhxYSwOjp 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231106_091758_863788_99C015DE X-CRM114-Status: GOOD ( 16.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/mfd/fsl-imx25-tsadc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/fsl-imx25-tsadc.c b/drivers/mfd/fsl-imx25-tsadc.c index 089c2ce615b6..74f38bf3778f 100644 --- a/drivers/mfd/fsl-imx25-tsadc.c +++ b/drivers/mfd/fsl-imx25-tsadc.c @@ -194,11 +194,9 @@ static int mx25_tsadc_probe(struct platform_device *pdev) return ret; } -static int mx25_tsadc_remove(struct platform_device *pdev) +static void mx25_tsadc_remove(struct platform_device *pdev) { mx25_tsadc_unset_irq(pdev); - - return 0; } static const struct of_device_id mx25_tsadc_ids[] = { @@ -213,7 +211,7 @@ static struct platform_driver mx25_tsadc_driver = { .of_match_table = mx25_tsadc_ids, }, .probe = mx25_tsadc_probe, - .remove = mx25_tsadc_remove, + .remove_new = mx25_tsadc_remove, }; module_platform_driver(mx25_tsadc_driver); From patchwork Mon Nov 6 17:17:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13447212 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0865C4167D for ; Mon, 6 Nov 2023 17:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LZRAHL1kxPh8Elvzyr7cpwBgHdN4Y82JJuWd4I8Nitk=; b=QtUoCwAM6ZtaRB NFfuQS9Q5DWCtwfxgb8U6USiKuwJrFB9tiPwxEWg88q69SPjMK1dX8tJhQUyLjjzHeiIS95VRyvl/ VNFpdNOuVGrKaRr6FHZmmh6852PS7NvrULRjQ+a0gKt+Lx4WU2NalK+2OXb6P+5n0tg2tF/xjQgEm /+MYAz++uA1rZHYC2/WhKpANM9i3EngsQT6MjltlJlQz2xTc25Ot5gI+C7D00HcdHyUhn/MjLqE1l ODv+TaDtLLyhahH7/5zf6yPvoUlZHi0CBV+Nd0t/ySMJ56+rnC+QZ/jFo44B5gV0fixY1leVi5wRm YnQnNb4f/U+WyBLoAzlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r03Ee-00HCwC-2X; Mon, 06 Nov 2023 17:18:00 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r03Ea-00HCsx-2a for linux-arm-kernel@lists.infradead.org; Mon, 06 Nov 2023 17:17:58 +0000 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 1r03ET-0005U8-Gc; Mon, 06 Nov 2023 18:17:49 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r03ET-0075yl-2s; Mon, 06 Nov 2023 18:17:49 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r03ES-00DrJH-Py; Mon, 06 Nov 2023 18:17:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Lee Jones Cc: Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 09/18] mfd: mxs-lradc: Convert to platform remove callback returning void Date: Mon, 6 Nov 2023 18:17:18 +0100 Message-ID: <20231106171708.3892347-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> References: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1686; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=GNK+c3Abifs5Um4n3RL+YvkDdPV3heWsrI7W1ir+IZ8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSR+fCaJ6YKeIfgaSRYJ+VtntxTS1jxS1g3H7Y y1ZQd/hUJeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUkfnwAKCRCPgPtYfRL+ ThuBB/9FPwWUBHIOHfI30axlRlt/aRMioT4Dlh/K4Stri/tkWDWtBWewZWHStSBJ5L1iST3WdcY pUqNheHY+SK0cN+3zaArFK4yZxdrLaHlGD5Jhdl5uXfXklBX0g87tmEF3I9DTmDonRa+bg9x5eE Md7tjevhDHaeHGTtnJv21D08H4hrRYsA1T49qHYu0tqSAsQoDv5SpYoZ99poBAZZlOphnQkccKB sXrnu4xH8Cpmq2zh6p7u7wGopR13FqB40RBwxYPwASfh+FW5uZkSTGY4QZlV163ow4IcIh7g2ML rT1s/3SeOUZ8X5sxgRmnZvEmbyoTVqKNqAcdQVbN9/oEou8l 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231106_091756_836332_907E15A0 X-CRM114-Status: GOOD ( 16.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/mfd/mxs-lradc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/mxs-lradc.c b/drivers/mfd/mxs-lradc.c index ec1b356562b9..73893890b50a 100644 --- a/drivers/mfd/mxs-lradc.c +++ b/drivers/mfd/mxs-lradc.c @@ -230,13 +230,11 @@ static int mxs_lradc_probe(struct platform_device *pdev) return ret; } -static int mxs_lradc_remove(struct platform_device *pdev) +static void mxs_lradc_remove(struct platform_device *pdev) { struct mxs_lradc *lradc = platform_get_drvdata(pdev); clk_disable_unprepare(lradc->clk); - - return 0; } static struct platform_driver mxs_lradc_driver = { @@ -245,7 +243,7 @@ static struct platform_driver mxs_lradc_driver = { .of_match_table = mxs_lradc_dt_ids, }, .probe = mxs_lradc_probe, - .remove = mxs_lradc_remove, + .remove_new = mxs_lradc_remove, }; module_platform_driver(mxs_lradc_driver); From patchwork Mon Nov 6 17:17:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13447211 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A7AFC41535 for ; Mon, 6 Nov 2023 17:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9AZC+NIaICAi2MFy3jpk/EZs8u0ev8YzU/hjzxS/12Q=; b=SIrWaOjElrZ7JH HsvieMk0jbTVVb7Qt8fs5PpGvERvQ6lbL0vmsJdnU2IQhhF98D15FDxANXKUNLqdooeA42qGR2czC SyuXhX6zyRxzzs1Ux3XDo97Y3w4PhJGZY91XwhlDUHyUfbtE5H93JzO0msV2GhHuLfrVfD5Lus5WF xv4VXyBNzJmOWh2erKh3cYELQVFeTalBd+5+h+hni814Kq4GmLCFlSKPGVCq69/fFzTH3CXSmF5Ql VeWQMjfqrhBnBQGpJNEEyplDXR5KAtB7n3Ur4gjOxXyRRs3dzsi4hIQH8dfziYSmMomKyt41tDMrJ 9qscA2wp4KzO2pIQGLlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r03Eh-00HCxZ-12; Mon, 06 Nov 2023 17:18:03 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r03Ea-00HCt6-2s for linux-arm-kernel@lists.infradead.org; Mon, 06 Nov 2023 17:17:59 +0000 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 1r03EV-0005au-7B; Mon, 06 Nov 2023 18:17:51 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r03EU-0075z9-AJ; Mon, 06 Nov 2023 18:17:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r03EU-00DrJf-0y; Mon, 06 Nov 2023 18:17:50 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Lee Jones Cc: Fabrice Gasnier , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 15/18] mfd: stm32-timers: Convert to platform remove callback returning void Date: Mon, 6 Nov 2023 18:17:24 +0100 Message-ID: <20231106171708.3892347-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> References: <20231106171708.3892347-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1913; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jVkK8Ke5hsybq+hJya3Qt2KaRP0LWkU08638E+yF+OA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlSR+mWnS+kDacKKlH4v2Liesd5r6OzwvKBRTf0 42Nudp3EaOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZUkfpgAKCRCPgPtYfRL+ Th4jCAChOnRByVuDoEEgRtaZ29TE4Wyd0c8x3Im/5GBUKAIQ6n5P2tWhAKBAbGN1hSisGBWGpSj OH4X2zfWLdJmyI3/emIZsuKOPr/GWj0XchRPJcEXyzLwkDX1ycZcHW9x8kbo96llWzEIwj/jNTf 9dNl0tD5lkD1QFA43/9XFjutwadfXB3uL7LbQ10QcGg32fGNxQTn/xSPehNpBlahbqNfJpyUGGN 2eBJaY3AXqtrimgG3lZlJTxq0aa8uMG2kqlKnNUooWmrdLG1G4MCdam4HoZ5CJu5LIlHKs7ukL3 AeIhRKQvvT5W5Jbaj06qCZSkpeiqMpFJkbxTaejZcq44NTok 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231106_091756_952951_29705A82 X-CRM114-Status: GOOD ( 16.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/mfd/stm32-timers.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/stm32-timers.c b/drivers/mfd/stm32-timers.c index a656a1c186a8..9fd13d88950c 100644 --- a/drivers/mfd/stm32-timers.c +++ b/drivers/mfd/stm32-timers.c @@ -306,7 +306,7 @@ static int stm32_timers_probe(struct platform_device *pdev) return ret; } -static int stm32_timers_remove(struct platform_device *pdev) +static void stm32_timers_remove(struct platform_device *pdev) { struct stm32_timers *ddata = platform_get_drvdata(pdev); @@ -316,8 +316,6 @@ static int stm32_timers_remove(struct platform_device *pdev) */ of_platform_depopulate(&pdev->dev); stm32_timers_dma_remove(&pdev->dev, ddata); - - return 0; } static const struct of_device_id stm32_timers_of_match[] = { @@ -328,7 +326,7 @@ MODULE_DEVICE_TABLE(of, stm32_timers_of_match); static struct platform_driver stm32_timers_driver = { .probe = stm32_timers_probe, - .remove = stm32_timers_remove, + .remove_new = stm32_timers_remove, .driver = { .name = "stm32-timers", .of_match_table = stm32_timers_of_match,