Skip to content

Commit f5072cf

Browse files
Uwe Kleine-Königabelvesa
authored andcommitted
clk: imx: imx8mp: 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. Fixes: 1496dd4 ("clk: imx: imx8mp: Add pm_runtime support for power saving") Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Abel Vesa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abel Vesa <[email protected]>
1 parent 57939f3 commit f5072cf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/imx/clk-imx8mp-audiomix.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,9 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev)
346346
return ret;
347347
}
348348

349-
static int clk_imx8mp_audiomix_remove(struct platform_device *pdev)
349+
static void clk_imx8mp_audiomix_remove(struct platform_device *pdev)
350350
{
351351
pm_runtime_disable(&pdev->dev);
352-
353-
return 0;
354352
}
355353

356354
static int clk_imx8mp_audiomix_runtime_suspend(struct device *dev)
@@ -382,7 +380,7 @@ MODULE_DEVICE_TABLE(of, clk_imx8mp_audiomix_of_match);
382380

383381
static struct platform_driver clk_imx8mp_audiomix_driver = {
384382
.probe = clk_imx8mp_audiomix_probe,
385-
.remove = clk_imx8mp_audiomix_remove,
383+
.remove_new = clk_imx8mp_audiomix_remove,
386384
.driver = {
387385
.name = "imx8mp-audio-blk-ctrl",
388386
.of_match_table = clk_imx8mp_audiomix_of_match,

0 commit comments

Comments
 (0)