From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: "MyungJoo Ham" <myungjoo.ham@samsung.com>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Chanwoo Choi" <cw00.choi@samsung.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Chen-Yu Tsai <wens@csie.org>,
Samuel Holland <samuel@sholland.org>,
linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, kernel@pengutronix.de
Subject: Re: [PATCH 5/5] PM / devfreq: sun8i-a33-mbus: Convert to platform remove callback returning void
Date: Mon, 04 Mar 2024 22:32:50 +0100 [thread overview]
Message-ID: <2719174.mvXUDI8C0e@jernej-laptop> (raw)
In-Reply-To: <0ca3f35bdf9549ccda7c6c10a476f28350d987df.1709587301.git.u.kleine-koenig@pengutronix.de>
Dne ponedeljek, 04. marec 2024 ob 22:28:43 CET je Uwe Kleine-König napisal(a):
> 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 <u.kleine-koenig@pengutronix.de>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/devfreq/sun8i-a33-mbus.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/devfreq/sun8i-a33-mbus.c b/drivers/devfreq/sun8i-a33-mbus.c
> index 13d32213139f..bcf654f4ff96 100644
> --- a/drivers/devfreq/sun8i-a33-mbus.c
> +++ b/drivers/devfreq/sun8i-a33-mbus.c
> @@ -458,7 +458,7 @@ static int sun8i_a33_mbus_probe(struct platform_device *pdev)
> return dev_err_probe(dev, ret, err);
> }
>
> -static int sun8i_a33_mbus_remove(struct platform_device *pdev)
> +static void sun8i_a33_mbus_remove(struct platform_device *pdev)
> {
> struct sun8i_a33_mbus *priv = platform_get_drvdata(pdev);
> unsigned long initial_freq = priv->profile.initial_freq;
> @@ -475,8 +475,6 @@ static int sun8i_a33_mbus_remove(struct platform_device *pdev)
> clk_rate_exclusive_put(priv->clk_mbus);
> clk_rate_exclusive_put(priv->clk_dram);
> clk_disable_unprepare(priv->clk_bus);
> -
> - return 0;
> }
>
> static const struct sun8i_a33_mbus_variant sun50i_a64_mbus = {
> @@ -497,7 +495,7 @@ static SIMPLE_DEV_PM_OPS(sun8i_a33_mbus_pm_ops,
>
> static struct platform_driver sun8i_a33_mbus_driver = {
> .probe = sun8i_a33_mbus_probe,
> - .remove = sun8i_a33_mbus_remove,
> + .remove_new = sun8i_a33_mbus_remove,
> .driver = {
> .name = "sun8i-a33-mbus",
> .of_match_table = sun8i_a33_mbus_of_match,
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-03-04 21:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240304212922epcas1p3f9a8c4fdf976f6d6266e3129bfcfb00c@epcas1p3.samsung.com>
2024-03-04 21:28 ` [PATCH 0/5] PM / devfreq: Convert to platform remove callback returning void Uwe Kleine-König
2024-03-04 21:28 ` [PATCH 1/5] PM / devfreq: exynos-nocp: " Uwe Kleine-König
2024-03-04 21:28 ` [PATCH 2/5] PM / devfreq: exynos-ppmu: " Uwe Kleine-König
2024-03-04 21:28 ` [PATCH 3/5] PM / devfreq: mtk-cci: " Uwe Kleine-König
2024-03-04 21:28 ` [PATCH 5/5] PM / devfreq: sun8i-a33-mbus: " Uwe Kleine-König
2024-03-04 21:32 ` Jernej Škrabec [this message]
2024-03-07 11:54 ` [PATCH 0/5] PM / devfreq: " Chanwoo Choi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2719174.mvXUDI8C0e@jernej-laptop \
--to=jernej.skrabec@gmail.com \
--cc=cw00.choi@samsung.com \
--cc=kernel@pengutronix.de \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=myungjoo.ham@samsung.com \
--cc=samuel@sholland.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox