From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68E3745014 for ; Sun, 17 Dec 2023 14:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9e-0006VK-T6; Sun, 17 Dec 2023 15:30:06 +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 1rEs9c-00GUh6-23; Sun, 17 Dec 2023 15:30:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9b-004hyt-Os; Sun, 17 Dec 2023 15:30:03 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Markus Mayer , Broadcom internal kernel review list , Florian Fainelli , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/15] memory: brcmstb_dpfe: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:27 +0100 Message-ID: <94780e5a414b20b6effa1e87208c14620c854e88.1702822744.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1782; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=NqCgvYjkJld3SgKTMzNoNFlN7UBIUNxiFFLbxrZ5cYQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXGl1AmJHmGkUrNQ1FnLcrkoZ4iDiokSMdTj kBRQcFosluJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FxgAKCRCPgPtYfRL+ TgZPB/4yygmvfAFl9kDpKc6eG2Iay0PbfcS9KAho672FuxXi2wYKFF92Z7VSJkHcnd6C6Ix+YRk LujlGAzxjH+9IWgeGNV9cz/jweGLzDqkYgRnawaziENAnDO3Iq7tP+/5170007yJdXpXlFysicj oqONP/mZMeQeFSvbOM7JyWFXaOc68SPyPMWNlAyyG7mzc/PRX+bAqHbCZ29SGzxLQC6egU9PYxY rqlrsHx5t2HOBm5Q0ZNsyHawSJ7InOwuk+KFmXAfaR+ddDLxVmO7f7LRPg0kGHREeWYYWhA8TtU T5eo7lMF2U4nXnyd1mIZSLzSno+1pyI6hIUnPNRqb4oKb9fv 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 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: Markus Mayer --- drivers/memory/brcmstb_dpfe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/brcmstb_dpfe.c b/drivers/memory/brcmstb_dpfe.c index a7ab3d377206..5028467b2dc9 100644 --- a/drivers/memory/brcmstb_dpfe.c +++ b/drivers/memory/brcmstb_dpfe.c @@ -909,13 +909,11 @@ static int brcmstb_dpfe_probe(struct platform_device = *pdev) return ret; } =20 -static int brcmstb_dpfe_remove(struct platform_device *pdev) +static void brcmstb_dpfe_remove(struct platform_device *pdev) { struct brcmstb_dpfe_priv *priv =3D dev_get_drvdata(&pdev->dev); =20 sysfs_remove_groups(&pdev->dev.kobj, priv->dpfe_api->sysfs_attrs); - - return 0; } =20 static const struct of_device_id brcmstb_dpfe_of_match[] =3D { @@ -936,7 +934,7 @@ static struct platform_driver brcmstb_dpfe_driver =3D { .of_match_table =3D brcmstb_dpfe_of_match, }, .probe =3D brcmstb_dpfe_probe, - .remove =3D brcmstb_dpfe_remove, + .remove_new =3D brcmstb_dpfe_remove, .resume =3D brcmstb_dpfe_resume, }; =20 --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E42045957 for ; Sun, 17 Dec 2023 14:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9e-0006VL-T4; Sun, 17 Dec 2023 15:30:06 +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 1rEs9c-00GUhA-95; Sun, 17 Dec 2023 15:30:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9b-004hyw-W6; Sun, 17 Dec 2023 15:30:04 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Florian Fainelli , Broadcom internal kernel review list , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 02/15] memory: brcmstb_memc: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:28 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1775; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=SpMi1wg6uau+YqEvL4zWCt8cnKaO+rNdF1rNrAv67zI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXHmWa9sJ09D5q7RteC6J2eSV0osYkFrjnhH GFnMTS5CiKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FxwAKCRCPgPtYfRL+ Tv08B/9jWNWVJdwg3eqyaHMspo0t4LNc4AS+YH6ZaFbvzn9MbVijqfopM3kx8fgJ91XdeKYJORL LWTgeid/MeA++pW7lAKZZtW+GHuRnndT8NgbXy2NyM8se82jcfVKSFGRDiom/MEqvPQPeTmNzqp j7SvQ0Igl8YTs0dWfgpfwe+xT1vFFp6Bkx3qfRdZXbT0pBAeTNhpHuzJNwDLo6xhKL3A3qZ548v go+HQS7OwjXD/22sZvYqQd8Qk9SQf+d22Atn3maaigOFc/shB+x0EE3Ez2J1jGC6MwfSCKiOP6o w28Sfrrobm7lWlTnMgH++7AwU+o+p4YZojmCgkVxFaxhsZ5s 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 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 --- drivers/memory/brcmstb_memc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/brcmstb_memc.c b/drivers/memory/brcmstb_memc.c index a6ea51996522..ea9213f7152e 100644 --- a/drivers/memory/brcmstb_memc.c +++ b/drivers/memory/brcmstb_memc.c @@ -152,13 +152,11 @@ static int brcmstb_memc_probe(struct platform_device = *pdev) return 0; } =20 -static int brcmstb_memc_remove(struct platform_device *pdev) +static void brcmstb_memc_remove(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; =20 sysfs_remove_group(&dev->kobj, &dev_attr_group); - - return 0; } =20 enum brcmstb_memc_hwtype { @@ -284,7 +282,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(brcmstb_memc_pm_ops, br= cmstb_memc_suspend, =20 static struct platform_driver brcmstb_memc_driver =3D { .probe =3D brcmstb_memc_probe, - .remove =3D brcmstb_memc_remove, + .remove_new =3D brcmstb_memc_remove, .driver =3D { .name =3D "brcmstb_memc", .of_match_table =3D brcmstb_memc_of_match, --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53FA444C84 for ; Sun, 17 Dec 2023 14:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9c-0006VM-WF; Sun, 17 Dec 2023 15:30:05 +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 1rEs9c-00GUhD-GI; Sun, 17 Dec 2023 15:30:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9c-004hz1-7A; Sun, 17 Dec 2023 15:30:04 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Santosh Shilimkar , linux-kernel@vger.kernel.org Subject: [PATCH 03/15] memory: emif: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:29 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1692; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=unkZGXW/GBMij3XUkpyQaAXYnruITJsZtJqqHnqW6wY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXIlYCuL20IU+oKd4SHoVuSVc2z9AqLE+XQP VhL8Zc1e3eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FyAAKCRCPgPtYfRL+ TkcuB/9xUatnUb3NxjSCoYvzf/ZDrQDjLfZpdz6ty/hfopPE7HsdjEpp1xC68ChCZFEpul2N6ka m5baMNk4B2dtrhQR4UMqwmMLL+NK4H57cYWbQmi2scmzb7nk72ewlnpvIy9x/zDbV4mGXWvuYL2 Cwnr3ddJKhhS1huGAh1sY+pasL7xBIIxjCg8PTV7stp1c+tCw7pf2pjPUtJq62Fz8nLhFBW3Yaw fSeVVqCsu+f/fF2/ji7ikpx+tew/rZft/hESOd53krOs9FxQcDfucVp2wMGDjjEp+SUT1I4pO/i 9chBR4OWfNTWcbjvh54/hUFbh4/wlGe004eGG4i2ccRe771G 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 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 --- drivers/memory/emif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index f305643209f0..434982545be6 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -1159,13 +1159,11 @@ static int __init_or_module emif_probe(struct platf= orm_device *pdev) return -ENODEV; } =20 -static int __exit emif_remove(struct platform_device *pdev) +static void __exit emif_remove(struct platform_device *pdev) { struct emif_data *emif =3D platform_get_drvdata(pdev); =20 emif_debugfs_exit(emif); - - return 0; } =20 static void emif_shutdown(struct platform_device *pdev) @@ -1185,7 +1183,7 @@ MODULE_DEVICE_TABLE(of, emif_of_match); #endif =20 static struct platform_driver emif_driver =3D { - .remove =3D __exit_p(emif_remove), + .remove_new =3D __exit_p(emif_remove), .shutdown =3D emif_shutdown, .driver =3D { .name =3D "emif", --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56FF744C74 for ; Sun, 17 Dec 2023 14:30:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9d-0006VQ-6T; Sun, 17 Dec 2023 15:30:05 +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 1rEs9c-00GUhG-Q0; Sun, 17 Dec 2023 15:30:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9c-004hz5-Gp; Sun, 17 Dec 2023 15:30:04 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 04/15] memory: fsl-corenet-cf: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:30 +0100 Message-ID: <3b506dcf90b57c341e59bcf5af7ee69092a2d857.1702822744.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1761; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=4GKd6L0J9ejMA+vYrbmphTcshFPUGEJl8XNbz0nTZqo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXKD2N267gDEQ6+5jqpmelYgMzz8hlB8epUD PGbWwv5StKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FygAKCRCPgPtYfRL+ TsMSB/4tyd+z/3jSZvqYtk7kHqOBS6yGBKMCquYj1vXCQM+aqhWqyzfWs2kR8ZF24XIa8cRIYwK a4+gmJV0ed+H5Sy5eSRX6KBd5WwMINfjiwq10aPA0bj6+TcxMZpVAwNZLbFmbwSDIRnpLTQG2o/ 0uV+CH/0QKBfvUkfjH0PzVqhQYf5VDvaWR1+W8Y3tcQFdrerzPYCz5vJxUQdZSxOvIk7jjeh3EM oe1VElX/IFxdJ5vbutdNV7lj6s/Odv2OKVALaTiBZf/SrXKcyk4MqIR1pPtEXYoryNCd55QEYei 7kSK2GCSllPdEFBgh++/V5UJJ1X5hRBLgiLQ7XZYlS2G0AMV 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 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 --- drivers/memory/fsl-corenet-cf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/fsl-corenet-cf.c b/drivers/memory/fsl-corenet-c= f.c index 8096c4f33303..f47d05f7c5c5 100644 --- a/drivers/memory/fsl-corenet-cf.c +++ b/drivers/memory/fsl-corenet-cf.c @@ -223,7 +223,7 @@ static int ccf_probe(struct platform_device *pdev) return 0; } =20 -static int ccf_remove(struct platform_device *pdev) +static void ccf_remove(struct platform_device *pdev) { struct ccf_private *ccf =3D dev_get_drvdata(&pdev->dev); =20 @@ -241,8 +241,6 @@ static int ccf_remove(struct platform_device *pdev) iowrite32be(0, &ccf->err_regs->errinten); break; } - - return 0; } =20 static struct platform_driver ccf_driver =3D { @@ -251,7 +249,7 @@ static struct platform_driver ccf_driver =3D { .of_match_table =3D ccf_matches, }, .probe =3D ccf_probe, - .remove =3D ccf_remove, + .remove_new =3D ccf_remove, }; =20 module_platform_driver(ccf_driver); --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56FBC32C86 for ; Sun, 17 Dec 2023 14:30:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9d-0006Vd-DX; Sun, 17 Dec 2023 15:30:05 +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 1rEs9d-00GUhJ-0P; Sun, 17 Dec 2023 15:30:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9c-004hz9-NZ; Sun, 17 Dec 2023 15:30:04 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 05/15] memory: fsl_ifc: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:31 +0100 Message-ID: <4c90b971e9816320586f4e01e68c95331b8e524a.1702822744.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1764; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=eSBa/fs8NodpdGdszaXDUc+ymMsxDWr2uvmVnp4C53Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXLxuA7kDucWGGRqw8PGSmNXnGtbc34NX5Ps jjEdWKqqK+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FywAKCRCPgPtYfRL+ Tj+2B/9I76sHZ3/XmoTh9IF8YE+UyAZ56dGm/AQVNrlGvKUkBwIBmTZ+g+adxfthZwO+qt56Pq/ URQybLtFhCu490mxmzvR7y3v7NpFCGODHGBdSr16lrlB60RVz3Q2F54s3l4S15BM1h1g9XfKnb8 07p/qO6wlkLpBmMrV+uJmmz+6P4BnofX9dsY4P3qXfbPA+nAQSqMqytcVaA5XTZHvcgVoS6rufH i9ggz9r6lA1Qh4SYnEwitVPXlOxGHVY94jR7cejRc9r7H5MRRIrsnt15L7f+88n3WG/hlkee7NB gcI2I76dxQqMdWwckvyT6wv2TMqU1gjPcKtCG5KHTvxetgoN 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 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 --- drivers/memory/fsl_ifc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c index 2509e5152036..15e919c24f81 100644 --- a/drivers/memory/fsl_ifc.c +++ b/drivers/memory/fsl_ifc.c @@ -84,7 +84,7 @@ static int fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl) return 0; } =20 -static int fsl_ifc_ctrl_remove(struct platform_device *dev) +static void fsl_ifc_ctrl_remove(struct platform_device *dev) { struct fsl_ifc_ctrl *ctrl =3D dev_get_drvdata(&dev->dev); =20 @@ -98,8 +98,6 @@ static int fsl_ifc_ctrl_remove(struct platform_device *de= v) iounmap(ctrl->gregs); =20 dev_set_drvdata(&dev->dev, NULL); - - return 0; } =20 /* @@ -318,7 +316,7 @@ static struct platform_driver fsl_ifc_ctrl_driver =3D { .of_match_table =3D fsl_ifc_match, }, .probe =3D fsl_ifc_ctrl_probe, - .remove =3D fsl_ifc_ctrl_remove, + .remove_new =3D fsl_ifc_ctrl_remove, }; =20 static int __init fsl_ifc_init(void) --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 698814594E for ; Sun, 17 Dec 2023 14:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9d-0006Vk-Jz; Sun, 17 Dec 2023 15:30:05 +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 1rEs9d-00GUhN-7G; Sun, 17 Dec 2023 15:30:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9c-004hzD-UL; Sun, 17 Dec 2023 15:30:04 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Paul Cercueil , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/15] memory: jz4780-nemc: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:32 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1789; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=GK2KZnqcdPQ7ce5OhcDXJKsNHWUaLDvnl9OrvLYV59Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXMSIuOgrnIXMD1kAk4I+wVgUgcHxmTddpF0 qFTcRdlnNaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FzAAKCRCPgPtYfRL+ Tp05B/4yqfZ5IZZi2h6BJZmfSEXr4OSgNKGOr/3MNfLkaHsCLkJEWUTHMcy0qsug2SfL08iyUpE QakKFZs2XfR6MyCKQRLv5ghZIc6jgP4F2Sr77TQZWQx3ON5P4QOP7vJChRukz+1OI57ZUOwIkbZ 4/LUHd+X8o/mAr92zOJmpdX3JjxqoNMh3unQu0zPpdIbEu+DrJg89IUuypv8XtzVYTqektxTX9F okA21bWCJGXBWLxqI/8y3z1YmerloN3D9USxtZoEiPsyN4IPZzpjFylajsl/56NyZdDcdlLchvx otOqdLbqCCeSpGz6w+Mczf/o7pQtI0U/g/Aqalf/q6/J1xi3 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 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: Paul Cercueil --- drivers/memory/jz4780-nemc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/memory/jz4780-nemc.c b/drivers/memory/jz4780-nemc.c index e5a93e7da15f..fb6db2ffe71b 100644 --- a/drivers/memory/jz4780-nemc.c +++ b/drivers/memory/jz4780-nemc.c @@ -384,12 +384,11 @@ static int jz4780_nemc_probe(struct platform_device *= pdev) return 0; } =20 -static int jz4780_nemc_remove(struct platform_device *pdev) +static void jz4780_nemc_remove(struct platform_device *pdev) { struct jz4780_nemc *nemc =3D platform_get_drvdata(pdev); =20 clk_disable_unprepare(nemc->clk); - return 0; } =20 static const struct jz_soc_info jz4740_soc_info =3D { @@ -408,7 +407,7 @@ static const struct of_device_id jz4780_nemc_dt_match[]= =3D { =20 static struct platform_driver jz4780_nemc_driver =3D { .probe =3D jz4780_nemc_probe, - .remove =3D jz4780_nemc_remove, + .remove_new =3D jz4780_nemc_remove, .driver =3D { .name =3D "jz4780-nemc", .of_match_table =3D of_match_ptr(jz4780_nemc_dt_match), --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DE5045BF2 for ; Sun, 17 Dec 2023 14:30:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9e-0006Vz-U0; Sun, 17 Dec 2023 15:30:06 +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 1rEs9d-00GUhR-Fv; Sun, 17 Dec 2023 15:30:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9d-004hzH-6b; Sun, 17 Dec 2023 15:30:05 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Yong Wu , Matthias Brugger , AngeloGioacchino Del Regno , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/15] memory: mtk-smi: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:33 +0100 Message-ID: <5c35a33cfdc359842e034ddd2e9358f10e91fa1f.1702822744.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=2760; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=nsC7YSob3OITdlCeKMTdDVDTrdjo8YuTORSn8Byw9y0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXN3/e8ieYkjMi1tAYZQl77ONh52chbRYAon ZmqHfYltDOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FzQAKCRCPgPtYfRL+ Tjm+CACaZe3fPNzfsFwX+VFxbpC0VXkBNDQp9G105jLOUAwYeNwMsNtQ8Ra7JbD3v/yciHSQC2k c2jN3f0dxUetCqeD3DbanuNuWKI2zJK5cgooyZ15CSK7RE3QsRUIFZpLOe/PgvEgCDo/6olp0VA 7UmbglPSPG/5ij8OPj6IEtinJCbK+p/nWAFvgBAE5EWXjY8mwH+3yl1bOWLD02aDQJ/ohcP4TuN ZZoEeLsxnJIttB6YjR1X/Y7KNJ3jvru9dDQQrAKK/GPfEfMkTH/HiSY6j/IM2fklHsBrvCu1hZF 3XhZLrsbdJUCcj2kGx+9zBnT5m7DIJYxOnImrnhE/aNZjIF6 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 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 --- drivers/memory/mtk-smi.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 6523cb510518..572c7fbdcfd3 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -566,14 +566,13 @@ static int mtk_smi_larb_probe(struct platform_device = *pdev) return ret; } =20 -static int mtk_smi_larb_remove(struct platform_device *pdev) +static void mtk_smi_larb_remove(struct platform_device *pdev) { struct mtk_smi_larb *larb =3D platform_get_drvdata(pdev); =20 device_link_remove(&pdev->dev, larb->smi_common_dev); pm_runtime_disable(&pdev->dev); component_del(&pdev->dev, &mtk_smi_larb_component_ops); - return 0; } =20 static int __maybe_unused mtk_smi_larb_resume(struct device *dev) @@ -616,7 +615,7 @@ static const struct dev_pm_ops smi_larb_pm_ops =3D { =20 static struct platform_driver mtk_smi_larb_driver =3D { .probe =3D mtk_smi_larb_probe, - .remove =3D mtk_smi_larb_remove, + .remove_new =3D mtk_smi_larb_remove, .driver =3D { .name =3D "mtk-smi-larb", .of_match_table =3D mtk_smi_larb_of_ids, @@ -795,14 +794,13 @@ static int mtk_smi_common_probe(struct platform_devic= e *pdev) return 0; } =20 -static int mtk_smi_common_remove(struct platform_device *pdev) +static void mtk_smi_common_remove(struct platform_device *pdev) { struct mtk_smi *common =3D dev_get_drvdata(&pdev->dev); =20 if (common->plat->type =3D=3D MTK_SMI_GEN2_SUB_COMM) device_link_remove(&pdev->dev, common->smi_common_dev); pm_runtime_disable(&pdev->dev); - return 0; } =20 static int __maybe_unused mtk_smi_common_resume(struct device *dev) @@ -842,7 +840,7 @@ static const struct dev_pm_ops smi_common_pm_ops =3D { =20 static struct platform_driver mtk_smi_common_driver =3D { .probe =3D mtk_smi_common_probe, - .remove =3D mtk_smi_common_remove, + .remove_new =3D mtk_smi_common_remove, .driver =3D { .name =3D "mtk-smi-common", .of_match_table =3D mtk_smi_common_of_ids, --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6855646445 for ; Sun, 17 Dec 2023 14:30:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9e-0006W7-5x; Sun, 17 Dec 2023 15:30:06 +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 1rEs9d-00GUhV-Lt; Sun, 17 Dec 2023 15:30:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9d-004hzL-CW; Sun, 17 Dec 2023 15:30:05 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Roger Quadros , Tony Lindgren , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/15] memory: omap-gpmc: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:34 +0100 Message-ID: <019d9dc31af9b30a6b675fec219e64b667475efd.1702822744.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1813; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=U5CGeCdz6QSAvrFQlhj98hj1wRRaTXzuJdwPMd0OWnY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXOgeJ/I+MLCCzaRR2S0hAuUidKX2H7fnV+l jyp10wIe56JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FzgAKCRCPgPtYfRL+ Th6oCACtPZCoIo+uH4FSx41yvLOR8wWQbzWGm9FpXYZXVzaWiiGYx6ommIRZqHHnhfz8L/bsbOJ /L6QVHQUGm+FaQFwgHndv3F0h30XiAbDgT7+z+7WSo8fntdsBhUJPgfjcI4TNt4Avcjt0cMf36j nJ23HdfmZqiQm3psRAgSdfkGn8FjYu+6KeeBqC/1asWM0dHPj041s24BJ52kZfif8R8fwE0VWbr h+/zdtOCNgWAE8TndXGCrkz9FbNpD0d0EMBpUnkMZfDmK+4qKVIqD/Cj7HuoQc6cJLsL+4reqzV UilU2v/he3wH8BxMi2LOUcFhFqg6cbMvAF0VVyIeUucdVK11 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 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 Reviewed-by: Tony Lindgren --- drivers/memory/omap-gpmc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index d78f73db37c8..80d038884207 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2690,7 +2690,7 @@ static int gpmc_probe(struct platform_device *pdev) return rc; } =20 -static int gpmc_remove(struct platform_device *pdev) +static void gpmc_remove(struct platform_device *pdev) { int i; struct gpmc_device *gpmc =3D platform_get_drvdata(pdev); @@ -2702,8 +2702,6 @@ static int gpmc_remove(struct platform_device *pdev) gpmc_mem_exit(); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } =20 #ifdef CONFIG_PM_SLEEP @@ -2747,7 +2745,7 @@ MODULE_DEVICE_TABLE(of, gpmc_dt_ids); =20 static struct platform_driver gpmc_driver =3D { .probe =3D gpmc_probe, - .remove =3D gpmc_remove, + .remove_new =3D gpmc_remove, .driver =3D { .name =3D DEVICE_NAME, .of_match_table =3D of_match_ptr(gpmc_dt_ids), --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5401444C8C for ; Sun, 17 Dec 2023 14:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9e-0006WA-83; Sun, 17 Dec 2023 15:30:06 +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 1rEs9d-00GUhZ-Ri; Sun, 17 Dec 2023 15:30:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9d-004hzO-Ic; Sun, 17 Dec 2023 15:30:05 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 09/15] memory: renesas-rpc-if: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:35 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1725; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=ZMDbiRa3FGTihhO4tO5ODGE29OSsGDt4kVGBu1a2R44=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXPj3UhNZgDNyg4+9bkx2WCA2L43Uy2kWkf2 vpluzZRuM2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8FzwAKCRCPgPtYfRL+ TiKUB/9qljxV2MeMzDUCTbF/CisoK5J7jGBMJKNKmSczc/ZId0wNcKIE/ZII9SiOa0sXgMqooq2 hdXWYXREWg4OuL+Q6yATWPNRJbgu8AcnTbBzxW5mdOnDUVjyH7XYjNdBeoddZQ4pO/c7GDbsJA9 9CXDI67v2k0lSPlOdxGxcw5FHk4jIV45aIdEVvr3YMxoAsM8TkKU8GU5hEyushutaxsNLJybyK5 06XicsJma81Z0Pxc/yJoTw3FJGgjhPQhkJyYpMPnHsEkDeSgQWmeJ+em1rCWYx+ldaoogQ+12FC 6oEs0QakXakB0gOgxA88WgRQdXWMH+NxXbJ/J+AYFLn9x/mv 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 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 --- drivers/memory/renesas-rpc-if.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-i= f.c index 9695b2d3ae59..3167826b236a 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -777,13 +777,11 @@ static int rpcif_probe(struct platform_device *pdev) return 0; } =20 -static int rpcif_remove(struct platform_device *pdev) +static void rpcif_remove(struct platform_device *pdev) { struct rpcif_priv *rpc =3D platform_get_drvdata(pdev); =20 platform_device_unregister(rpc->vdev); - - return 0; } =20 static const struct of_device_id rpcif_of_match[] =3D { @@ -797,7 +795,7 @@ MODULE_DEVICE_TABLE(of, rpcif_of_match); =20 static struct platform_driver rpcif_driver =3D { .probe =3D rpcif_probe, - .remove =3D rpcif_remove, + .remove_new =3D rpcif_remove, .driver =3D { .name =3D "rpc-if", .of_match_table =3D rpcif_of_match, --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70B7746545 for ; Sun, 17 Dec 2023 14:30:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9f-0006WW-9b; Sun, 17 Dec 2023 15:30:07 +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 1rEs9e-00GUhc-2u; Sun, 17 Dec 2023 15:30:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9d-004hzT-Pr; Sun, 17 Dec 2023 15:30:05 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Lukasz Luba , Alim Akhtar , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/15] memory: exynos5422-dmc: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:36 +0100 Message-ID: <167dbda286584eafec07da8c11673da07ba72362.1702822744.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=2061; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=FHOjgtzRIN9XHjUcxCP7MGMz7yRB1JuZQ6LGi2PE66k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXQmW+Q6PEK4vacr/EoUiA1qF6qrGQu4k8BB 9+ceA0cHFWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8F0AAKCRCPgPtYfRL+ TibiCAC1uo4RR6+/cFLGqWwewyu7CjBqgCgdaQNtmQtdcpP2BuwkSLign+vU7FxZOYvzOomdeb7 Kbha57cN1prbQpTJKp03UX5Y1TyYuVy9YkkPh+Ac2Xi2b98vREFLjfHkN36A2dnfUjLBm4v34+7 vE1YzF5TRy+eKezWaP/iCLmnv85eU9Sn5FMf6SYKYcOEWOuesQzWE+LzP4pM+h4Qsu7IkMOMtgl Hp8SNhDVJklZXTzVGDXH1qQETrw545SnVH1mjxL044eXLlp+mYtBnJhB160GOkhvLz6Z/jZmBgh 50xvY3amw2c7RHVnhGLOYfeiqWmVuYPjiebx2NauufYrlzb+ 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 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 --- drivers/memory/samsung/exynos5422-dmc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsu= ng/exynos5422-dmc.c index 6d019dbd721c..da7ecd921c72 100644 --- a/drivers/memory/samsung/exynos5422-dmc.c +++ b/drivers/memory/samsung/exynos5422-dmc.c @@ -1558,7 +1558,7 @@ static int exynos5_dmc_probe(struct platform_device *= pdev) * clean the device's resources. It just calls explicitly disable function= for * the performance counters. */ -static int exynos5_dmc_remove(struct platform_device *pdev) +static void exynos5_dmc_remove(struct platform_device *pdev) { struct exynos5_dmc *dmc =3D dev_get_drvdata(&pdev->dev); =20 @@ -1569,8 +1569,6 @@ static int exynos5_dmc_remove(struct platform_device = *pdev) =20 clk_disable_unprepare(dmc->mout_bpll); clk_disable_unprepare(dmc->fout_bpll); - - return 0; } =20 static const struct of_device_id exynos5_dmc_of_match[] =3D { @@ -1581,7 +1579,7 @@ MODULE_DEVICE_TABLE(of, exynos5_dmc_of_match); =20 static struct platform_driver exynos5_dmc_platdrv =3D { .probe =3D exynos5_dmc_probe, - .remove =3D exynos5_dmc_remove, + .remove_new =3D exynos5_dmc_remove, .driver =3D { .name =3D "exynos5-dmc", .of_match_table =3D exynos5_dmc_of_match, --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CE9A45BF0 for ; Sun, 17 Dec 2023 14:30:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9f-0006XQ-MC; Sun, 17 Dec 2023 15:30:07 +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 1rEs9e-00GUhg-AA; Sun, 17 Dec 2023 15:30:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9e-004hzc-0q; Sun, 17 Dec 2023 15:30:06 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Maxime Coquelin , Alexandre Torgue , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 11/15] memory: stm32-fmc2-ebi: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:37 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1981; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=vnXMNpPc4CNH6yHCGy/VEkrbe/7SkdFU6zjQKAFNmw4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXRzgYeIa1M6T02trXcwbebDDAXRteH/aASJ EIeTmDpO4CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8F0QAKCRCPgPtYfRL+ Tlm4B/9oZRXDNti3I91lE3SnU/Anh5vxwqoEOcMKmojlJ6DMKjre9S0FWbf7LQ6tIOgJChGdJfI 5DJb4OZKt42SL/tFDSzqh/EIvKdDcV6WF4wuBJzQFCqTE7aRfQOmeuQZPVa1gyZwV44OR23niIj 4I10JoIIcuAKjKIWXa8Z4H/lV/048Q8W1IMiMvPG9bGFpkim7ypa/edmlbt5Nt49YU7qZB2+1/b GOxAwmrXq8yWvc3cKNRiNHA3xmgZtva1Q5qt8yg7E+rUC1yhzKYW5MJBy4UAipDxk5R9ZZv5k5s HJuw65+ON7MO74lTZicb9ZGvxEyXS8f+od6/Urr+eAKk7vEd 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 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 --- drivers/memory/stm32-fmc2-ebi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/stm32-fmc2-ebi.c b/drivers/memory/stm32-fmc2-eb= i.c index 9015e8277dc8..47d0ea5f1616 100644 --- a/drivers/memory/stm32-fmc2-ebi.c +++ b/drivers/memory/stm32-fmc2-ebi.c @@ -1146,7 +1146,7 @@ static int stm32_fmc2_ebi_probe(struct platform_devic= e *pdev) return ret; } =20 -static int stm32_fmc2_ebi_remove(struct platform_device *pdev) +static void stm32_fmc2_ebi_remove(struct platform_device *pdev) { struct stm32_fmc2_ebi *ebi =3D platform_get_drvdata(pdev); =20 @@ -1154,8 +1154,6 @@ static int stm32_fmc2_ebi_remove(struct platform_devi= ce *pdev) stm32_fmc2_ebi_disable_banks(ebi); stm32_fmc2_ebi_disable(ebi); clk_disable_unprepare(ebi->clk); - - return 0; } =20 static int __maybe_unused stm32_fmc2_ebi_suspend(struct device *dev) @@ -1197,7 +1195,7 @@ MODULE_DEVICE_TABLE(of, stm32_fmc2_ebi_match); =20 static struct platform_driver stm32_fmc2_ebi_driver =3D { .probe =3D stm32_fmc2_ebi_probe, - .remove =3D stm32_fmc2_ebi_remove, + .remove_new =3D stm32_fmc2_ebi_remove, .driver =3D { .name =3D "stm32_fmc2_ebi", .of_match_table =3D stm32_fmc2_ebi_match, --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57DDF44C90 for ; Sun, 17 Dec 2023 14:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9f-0006XT-NU; Sun, 17 Dec 2023 15:30:07 +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 1rEs9e-00GUhk-HB; Sun, 17 Dec 2023 15:30:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9e-004hzg-7v; Sun, 17 Dec 2023 15:30:06 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Thierry Reding , Jonathan Hunter , Sumit Gupta , Nick Alcock , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 12/15] memory: tegra186-emc: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:38 +0100 Message-ID: <8481c7e7d5b024325e6b1aabf7cb3a3707d211d6.1702822744.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1927; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=8/pftyzoFtmGA6p6jcaOA6JIc1RRi2neeGtIXzu26sU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXTkEYXXtmYxZ4s8+U/GoL3SKSKZkW9evRbN GNv9diXtaCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8F0wAKCRCPgPtYfRL+ TmZ3B/wJqToPNYpxaErGUho2q1O5sv/fIn6IWr3tr95NscNpSGNq98icF5USm3P5n1jy5oK88H5 YAQSlahvOmYs3rlGOim9tJoxC8ItfqRb/3iRX6qQGuZNw1Cc2JLO5LSJTUwW93w8XhpJ/5bULki krUehMq8ikMVSaZW3KbOp6KmNOeb5XcSZvDAZG8BOsEs6rnyGCH024RseHZVmIsR23awOUiW2Yb MQTegUYdZs/1HF0lmqThU3+P2nSaTP3hFGNZg/PQs8jrZlUdrLS4v0rlEznJwT4uX/7mXikD8Fs 3A+Mud6NvEvfG5kelN5c+20Hev2uWwabIDmkMFzMf9eCMY3E 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 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 --- drivers/memory/tegra/tegra186-emc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/tegra/tegra186-emc.c b/drivers/memory/tegra/teg= ra186-emc.c index 4007f4e16d74..fcd4aea48bda 100644 --- a/drivers/memory/tegra/tegra186-emc.c +++ b/drivers/memory/tegra/tegra186-emc.c @@ -378,7 +378,7 @@ static int tegra186_emc_probe(struct platform_device *p= dev) return err; } =20 -static int tegra186_emc_remove(struct platform_device *pdev) +static void tegra186_emc_remove(struct platform_device *pdev) { struct tegra_mc *mc =3D dev_get_drvdata(pdev->dev.parent); struct tegra186_emc *emc =3D platform_get_drvdata(pdev); @@ -387,8 +387,6 @@ static int tegra186_emc_remove(struct platform_device *= pdev) =20 mc->bpmp =3D NULL; tegra_bpmp_put(emc->bpmp); - - return 0; } =20 static const struct of_device_id tegra186_emc_of_match[] =3D { @@ -413,7 +411,7 @@ static struct platform_driver tegra186_emc_driver =3D { .sync_state =3D icc_sync_state, }, .probe =3D tegra186_emc_probe, - .remove =3D tegra186_emc_remove, + .remove_new =3D tegra186_emc_remove, }; module_platform_driver(tegra186_emc_driver); =20 --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E3E046453 for ; Sun, 17 Dec 2023 14:30:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9f-0006Y8-By; Sun, 17 Dec 2023 15:30:07 +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 1rEs9e-00GUhn-Nz; Sun, 17 Dec 2023 15:30:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9e-004hzk-Ef; Sun, 17 Dec 2023 15:30:06 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Thierry Reding , Jonathan Hunter , Rob Herring , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 13/15] memory: tegra210-emc: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:39 +0100 Message-ID: <3e2951685dddbc0ab32244916a9849af206a6730.1702822744.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1901; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=bGdyoxMNmY/bbwpr5SN+sb3K9b9jnZzp/Hcxotdsv9Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXUZZG5GWUBTUeLiKtuoBiiZylSrm31PtSWX 94NiU6Y59uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8F1AAKCRCPgPtYfRL+ TgCOB/0dPqf5bYKYlXnyRskNAJ2J1KfXnjmdTEdDVhDx7V8W651gEkJ9kWcgIzMMPe1kNm9w/MY /FZWlvbRm+V21imJBp+IdlVEXmodVoxUIwNOuZcKHz2yP/OSnVf8zfhKPorwXKlH/wT/INl4zzj +Pp7/rJ8FcK4/aCw0fdDYKFlGNvaThJQ4VOY/UeHWvqjAnhYDzc/gNwlbV0mKnaiBA9aaJV3neO ++YWHaihxoT0q8mH8WePbRn7Xf1x6AvpL/1VSfbvIXOmGixnJk50Zj8A5ci7txtFmrLqJ3yTTg1 gM3wuXnlc82ARyW0RhkX1kgKKS5rMIX9fyRC7pAkdkeMOsaI 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 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 --- drivers/memory/tegra/tegra210-emc-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegr= a/tegra210-emc-core.c index 3300bde47c13..78ca1d6c0977 100644 --- a/drivers/memory/tegra/tegra210-emc-core.c +++ b/drivers/memory/tegra/tegra210-emc-core.c @@ -1985,15 +1985,13 @@ static int tegra210_emc_probe(struct platform_devic= e *pdev) return err; } =20 -static int tegra210_emc_remove(struct platform_device *pdev) +static void tegra210_emc_remove(struct platform_device *pdev) { struct tegra210_emc *emc =3D platform_get_drvdata(pdev); =20 debugfs_remove_recursive(emc->debugfs.root); tegra210_clk_emc_detach(emc->clk); of_reserved_mem_device_release(emc->dev); - - return 0; } =20 static int __maybe_unused tegra210_emc_suspend(struct device *dev) @@ -2053,7 +2051,7 @@ static struct platform_driver tegra210_emc_driver =3D= { .pm =3D &tegra210_emc_pm_ops, }, .probe =3D tegra210_emc_probe, - .remove =3D tegra210_emc_remove, + .remove_new =3D tegra210_emc_remove, }; =20 module_platform_driver(tegra210_emc_driver); --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6701844C89 for ; Sun, 17 Dec 2023 14:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9f-0006ZL-Lm; Sun, 17 Dec 2023 15:30:07 +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 1rEs9e-00GUhq-U6; Sun, 17 Dec 2023 15:30:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9e-004hzo-Ky; Sun, 17 Dec 2023 15:30:06 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Santosh Shilimkar , linux-kernel@vger.kernel.org Subject: [PATCH 14/15] memory: ti-aemif: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:40 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1588; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=pyWtWmiwYcg0+6LNzRmjSApIX5L5AKsgQVYFlPzrv+I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXVntZp5sOxEOB/5fkXOzLz4JVmjpvWLituw Z1H3E7JdPOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8F1QAKCRCPgPtYfRL+ ThtuB/9hagkz+RKxDNMHvUqlVsrSIea6Z/3Ptua567Bbsvv/Vm/TW9rnx7r+HP2TtK9PxA+bzZZ 4goIWx5Qec11dH9oFCSVMNlkBiFi910QfVU9ZPk3G774DGlVirfuMCYzu9RgPkqRuVfaaSrq4Be Uf+KUw3YHBNw7gbJCnLtetkBABlrE79c9OT6DRH7ZBJV16it75dcM0Hiz7H9/O+sDzKMAeYEXNk 9pqzSpiGFUDRVgGluK1J+lt99l2Rqu9q++pJn9yi70IZSh3s6ZOFShjKJpaT7X9wx9DEg/PjAvb Zha3UerYfgny7tttBSdN4e7euXHi9YMhv//K/d/SkYJb/e0h 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 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 --- drivers/memory/ti-aemif.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c index f81e7df8798a..e192db9e0e4b 100644 --- a/drivers/memory/ti-aemif.c +++ b/drivers/memory/ti-aemif.c @@ -427,17 +427,16 @@ static int aemif_probe(struct platform_device *pdev) return ret; } =20 -static int aemif_remove(struct platform_device *pdev) +static void aemif_remove(struct platform_device *pdev) { struct aemif_device *aemif =3D platform_get_drvdata(pdev); =20 clk_disable_unprepare(aemif->clk); - return 0; } =20 static struct platform_driver aemif_driver =3D { .probe =3D aemif_probe, - .remove =3D aemif_remove, + .remove_new =3D aemif_remove, .driver =3D { .name =3D "ti-aemif", .of_match_table =3D of_match_ptr(aemif_of_match), --=20 2.42.0 From nobody Thu Nov 14 05:12:17 2024 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6636144C81 for ; Sun, 17 Dec 2023 14:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rEs9f-0006b0-O8; Sun, 17 Dec 2023 15:30:07 +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 1rEs9f-00GUhw-4D; Sun, 17 Dec 2023 15:30:07 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rEs9e-004hzs-RU; Sun, 17 Dec 2023 15:30:06 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: kernel@pengutronix.de, Santosh Shilimkar , linux-kernel@vger.kernel.org Subject: [PATCH 15/15] memory: ti-emif-pm: Convert to platform remove callback returning void Date: Sun, 17 Dec 2023 15:29:41 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1748; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=WJZhwPTIlOIcqqLEYHwjtW0719qozbE7mBK83LkfWTk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlfwXWitg8IFqEzU/x3i9wOHluf61iEJdKFWz4e sP6AwJyr2WJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZX8F1gAKCRCPgPtYfRL+ TgQcB/4+1a//3wge4lcfstHDq+FtIiQnRK37NbknYbLzRn5tWA54WLLrR4a0XofCL0GN7YSRAHU 4tu7BUdnZCOxDdTjz/RR1yEFaLgGcij11HxXSoguQ8KEQqsynys0RfRr9AgK687x9PEQeE4+jwg iBLkifzP7BlGxsEpEwtjXc7MsLsFthQ0n80xxHwYrTEZrcFNFUXb/tTkZ8wcn6tTKpS0xeTjAyO rnJNt7KewIhXFdaYSDGNCrXPpPC6DuvbNzoD3e1G+nqPdPsEDotvhJn9KQaQnhFq7Ie074cWR8J nOhS3nF+wQonHYpPT2GhaRRqVFOzI5vIZTIkGTNQ0DXlxpO2 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 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 --- drivers/memory/ti-emif-pm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/ti-emif-pm.c b/drivers/memory/ti-emif-pm.c index cef0d3beb63b..592f70e9c8e5 100644 --- a/drivers/memory/ti-emif-pm.c +++ b/drivers/memory/ti-emif-pm.c @@ -315,15 +315,13 @@ static int ti_emif_probe(struct platform_device *pdev) return ret; } =20 -static int ti_emif_remove(struct platform_device *pdev) +static void ti_emif_remove(struct platform_device *pdev) { struct ti_emif_data *emif_data =3D emif_instance; =20 emif_instance =3D NULL; =20 ti_emif_free_sram(emif_data); - - return 0; } =20 static const struct dev_pm_ops ti_emif_pm_ops =3D { @@ -332,7 +330,7 @@ static const struct dev_pm_ops ti_emif_pm_ops =3D { =20 static struct platform_driver ti_emif_driver =3D { .probe =3D ti_emif_probe, - .remove =3D ti_emif_remove, + .remove_new =3D ti_emif_remove, .driver =3D { .name =3D KBUILD_MODNAME, .of_match_table =3D ti_emif_of_match, --=20 2.42.0