Skip to content

Commit d963f25

Browse files
Uwe Kleine-Königbebarino
authored andcommitted
clk: starfive: jh7110-vout: Convert to platform remove callback returning void
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 <[email protected]> Link: https://lore.kernel.org/r/90054b8b2e118bc04ec37e044d0ac518bb177cf4.1709721042.git.u.kleine-koenig@pengutronix.de Reviewed-by: Hal Feng <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 4421d8b commit d963f25

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/starfive/clk-starfive-jh7110-vout.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,10 @@ static int jh7110_voutcrg_probe(struct platform_device *pdev)
209209
return ret;
210210
}
211211

212-
static int jh7110_voutcrg_remove(struct platform_device *pdev)
212+
static void jh7110_voutcrg_remove(struct platform_device *pdev)
213213
{
214214
pm_runtime_put_sync(&pdev->dev);
215215
pm_runtime_disable(&pdev->dev);
216-
217-
return 0;
218216
}
219217

220218
static const struct of_device_id jh7110_voutcrg_match[] = {
@@ -225,7 +223,7 @@ MODULE_DEVICE_TABLE(of, jh7110_voutcrg_match);
225223

226224
static struct platform_driver jh7110_voutcrg_driver = {
227225
.probe = jh7110_voutcrg_probe,
228-
.remove = jh7110_voutcrg_remove,
226+
.remove_new = jh7110_voutcrg_remove,
229227
.driver = {
230228
.name = "clk-starfive-jh7110-vout",
231229
.of_match_table = jh7110_voutcrg_match,

0 commit comments

Comments
 (0)