Skip to content

Commit 4421d8b

Browse files
Uwe Kleine-Königbebarino
authored andcommitted
clk: starfive: jh7110-isp: 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/312ec7052c4e327c0b365e167a8e86b406cb7dfa.1709721042.git.u.kleine-koenig@pengutronix.de Reviewed-by: Hal Feng <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 6995c4f commit 4421d8b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,10 @@ static int jh7110_ispcrg_probe(struct platform_device *pdev)
202202
return ret;
203203
}
204204

205-
static int jh7110_ispcrg_remove(struct platform_device *pdev)
205+
static void jh7110_ispcrg_remove(struct platform_device *pdev)
206206
{
207207
pm_runtime_put_sync(&pdev->dev);
208208
pm_runtime_disable(&pdev->dev);
209-
210-
return 0;
211209
}
212210

213211
static const struct of_device_id jh7110_ispcrg_match[] = {
@@ -218,7 +216,7 @@ MODULE_DEVICE_TABLE(of, jh7110_ispcrg_match);
218216

219217
static struct platform_driver jh7110_ispcrg_driver = {
220218
.probe = jh7110_ispcrg_probe,
221-
.remove = jh7110_ispcrg_remove,
219+
.remove_new = jh7110_ispcrg_remove,
222220
.driver = {
223221
.name = "clk-starfive-jh7110-isp",
224222
.of_match_table = jh7110_ispcrg_match,

0 commit comments

Comments
 (0)