Skip to content

Commit 6995c4f

Browse files
Uwe Kleine-Königbebarino
authored andcommitted
clk: imx: imx8-acm: 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/ba373ce7341518216a4940e76ce61d759b912b3d.1709721042.git.u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd <[email protected]>
1 parent 6613476 commit 6995c4f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/imx/clk-imx8-acm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,13 @@ static int imx8_acm_clk_probe(struct platform_device *pdev)
394394
return ret;
395395
}
396396

397-
static int imx8_acm_clk_remove(struct platform_device *pdev)
397+
static void imx8_acm_clk_remove(struct platform_device *pdev)
398398
{
399399
struct imx8_acm_priv *priv = dev_get_drvdata(&pdev->dev);
400400

401401
pm_runtime_disable(&pdev->dev);
402402

403403
clk_imx_acm_detach_pm_domains(&pdev->dev, &priv->dev_pm);
404-
405-
return 0;
406404
}
407405

408406
static const struct imx8_acm_soc_data imx8qm_acm_data = {
@@ -470,7 +468,7 @@ static struct platform_driver imx8_acm_clk_driver = {
470468
.pm = &imx8_acm_pm_ops,
471469
},
472470
.probe = imx8_acm_clk_probe,
473-
.remove = imx8_acm_clk_remove,
471+
.remove_new = imx8_acm_clk_remove,
474472
};
475473
module_platform_driver(imx8_acm_clk_driver);
476474

0 commit comments

Comments
 (0)