Skip to content

Commit 77647eb

Browse files
Uwe Kleine-Königstorulf
authored andcommitted
pmdomain: imx93-blk-ctrl: 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/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 7476ddf commit 77647eb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pmdomain/imx/imx93-blk-ctrl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static int imx93_blk_ctrl_probe(struct platform_device *pdev)
306306
return ret;
307307
}
308308

309-
static int imx93_blk_ctrl_remove(struct platform_device *pdev)
309+
static void imx93_blk_ctrl_remove(struct platform_device *pdev)
310310
{
311311
struct imx93_blk_ctrl *bc = dev_get_drvdata(&pdev->dev);
312312
int i;
@@ -318,8 +318,6 @@ static int imx93_blk_ctrl_remove(struct platform_device *pdev)
318318

319319
pm_genpd_remove(&domain->genpd);
320320
}
321-
322-
return 0;
323321
}
324322

325323
static const struct imx93_blk_ctrl_domain_data imx93_media_blk_ctl_domain_data[] = {
@@ -438,7 +436,7 @@ MODULE_DEVICE_TABLE(of, imx93_blk_ctrl_of_match);
438436

439437
static struct platform_driver imx93_blk_ctrl_driver = {
440438
.probe = imx93_blk_ctrl_probe,
441-
.remove = imx93_blk_ctrl_remove,
439+
.remove_new = imx93_blk_ctrl_remove,
442440
.driver = {
443441
.name = "imx93-blk-ctrl",
444442
.of_match_table = imx93_blk_ctrl_of_match,

0 commit comments

Comments
 (0)