* [PATCH 0/5] PM / devfreq: Convert to platform remove callback returning void @ 2024-03-04 21:28 ` Uwe Kleine-König 2024-03-04 21:28 ` [PATCH 5/5] PM / devfreq: sun8i-a33-mbus: " Uwe Kleine-König 2024-03-07 11:54 ` [PATCH 0/5] PM / devfreq: " Chanwoo Choi 0 siblings, 2 replies; 4+ messages in thread From: Uwe Kleine-König @ 2024-03-04 21:28 UTC (permalink / raw) To: Chanwoo Choi, MyungJoo Ham, Kyungmin Park Cc: Krzysztof Kozlowski, Alim Akhtar, linux-pm, linux-arm-kernel, linux-samsung-soc, kernel, Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, linux-sunxi Hello, this series converts all drivers below drivers/devfreq to struct platform_driver::remove_new(). See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for an extended explanation and the eventual goal. All conversations are trivial, because their .remove() callbacks returned zero unconditionally. There are no interdependencies between these patches, so they could be picked up individually. But I'd hope that they get picked up all together by the devfreq maintainers. Best regards Uwe Uwe Kleine-König (5): PM / devfreq: exynos-nocp: Convert to platform remove callback returning void PM / devfreq: exynos-ppmu: Convert to platform remove callback returning void PM / devfreq: mtk-cci: Convert to platform remove callback returning void PM / devfreq: rk3399_dmc: Convert to platform remove callback returning void PM / devfreq: sun8i-a33-mbus: Convert to platform remove callback returning void drivers/devfreq/event/exynos-nocp.c | 6 ++---- drivers/devfreq/event/exynos-ppmu.c | 6 ++---- drivers/devfreq/mtk-cci-devfreq.c | 6 ++---- drivers/devfreq/rk3399_dmc.c | 6 ++---- drivers/devfreq/sun8i-a33-mbus.c | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) base-commit: 67908bf6954b7635d33760ff6dfc189fc26ccc89 -- 2.43.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 5/5] PM / devfreq: sun8i-a33-mbus: Convert to platform remove callback returning void 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 ` Uwe Kleine-König 2024-03-04 21:32 ` Jernej Škrabec 2024-03-07 11:54 ` [PATCH 0/5] PM / devfreq: " Chanwoo Choi 1 sibling, 1 reply; 4+ messages in thread From: Uwe Kleine-König @ 2024-03-04 21:28 UTC (permalink / raw) To: MyungJoo Ham, Kyungmin Park, Chanwoo Choi Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, linux-pm, linux-arm-kernel, linux-sunxi, kernel 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> --- 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, -- 2.43.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 5/5] PM / devfreq: sun8i-a33-mbus: Convert to platform remove callback returning void 2024-03-04 21:28 ` [PATCH 5/5] PM / devfreq: sun8i-a33-mbus: " Uwe Kleine-König @ 2024-03-04 21:32 ` Jernej Škrabec 0 siblings, 0 replies; 4+ messages in thread From: Jernej Škrabec @ 2024-03-04 21:32 UTC (permalink / raw) To: MyungJoo Ham, Kyungmin Park, Chanwoo Choi, Uwe Kleine-König Cc: Chen-Yu Tsai, Samuel Holland, linux-pm, linux-arm-kernel, linux-sunxi, kernel 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, > ^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 0/5] PM / devfreq: Convert to platform remove callback returning void 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 5/5] PM / devfreq: sun8i-a33-mbus: " Uwe Kleine-König @ 2024-03-07 11:54 ` Chanwoo Choi 1 sibling, 0 replies; 4+ messages in thread From: Chanwoo Choi @ 2024-03-07 11:54 UTC (permalink / raw) To: 'Uwe Kleine-König', 'MyungJoo Ham', 'Kyungmin Park' Cc: 'Krzysztof Kozlowski', 'Alim Akhtar', linux-pm, linux-arm-kernel, linux-samsung-soc, kernel, 'Matthias Brugger', 'AngeloGioacchino Del Regno', linux-mediatek, 'Chen-Yu Tsai', 'Jernej Skrabec', 'Samuel Holland', linux-sunxi > -----Original Message----- > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Sent: Tuesday, March 5, 2024 6:29 AM > To: Chanwoo Choi <cw00.choi@samsung.com>; MyungJoo Ham > <myungjoo.ham@samsung.com>; Kyungmin Park <kyungmin.park@samsung.com> > Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>; Alim Akhtar > <alim.akhtar@samsung.com>; linux-pm@vger.kernel.org; linux-arm- > kernel@lists.infradead.org; linux-samsung-soc@vger.kernel.org; > kernel@pengutronix.de; Matthias Brugger <matthias.bgg@gmail.com>; > AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>; linux- > mediatek@lists.infradead.org; Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec > <jernej.skrabec@gmail.com>; Samuel Holland <samuel@sholland.org>; linux- > sunxi@lists.linux.dev > Subject: [PATCH 0/5] PM / devfreq: Convert to platform remove callback > returning void > > Hello, > > this series converts all drivers below drivers/devfreq to struct > platform_driver::remove_new(). See commit 5c5a7680e67b ("platform: Provide a > remove callback that returns no value") for an extended explanation and the > eventual goal. > > All conversations are trivial, because their .remove() callbacks returned > zero unconditionally. > > There are no interdependencies between these patches, so they could be picked > up individually. But I'd hope that they get picked up all together by the > devfreq maintainers. > > Best regards > Uwe > > Uwe Kleine-König (5): > PM / devfreq: exynos-nocp: Convert to platform remove callback returning > void > PM / devfreq: exynos-ppmu: Convert to platform remove callback returning > void > PM / devfreq: mtk-cci: Convert to platform remove callback returning void > PM / devfreq: rk3399_dmc: Convert to platform remove callback returning > void > PM / devfreq: sun8i-a33-mbus: Convert to platform remove callback returning > void > > drivers/devfreq/event/exynos-nocp.c | 6 ++---- > drivers/devfreq/event/exynos-ppmu.c | 6 ++---- > drivers/devfreq/mtk-cci-devfreq.c | 6 ++---- > drivers/devfreq/rk3399_dmc.c | 6 ++---- > drivers/devfreq/sun8i-a33-mbus.c | 6 ++---- > 5 files changed, 10 insertions(+), 20 deletions(-) > > base-commit: 67908bf6954b7635d33760ff6dfc189fc26ccc89 > -- > 2.43.0 > Applied it. Thanks. Best Regards, Chanwoo Choi ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-07 11:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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 5/5] PM / devfreq: sun8i-a33-mbus: " Uwe Kleine-König
2024-03-04 21:32 ` Jernej Škrabec
2024-03-07 11:54 ` [PATCH 0/5] PM / devfreq: " Chanwoo Choi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox