Skip to content

Commit e89c7c3

Browse files
Uwe Kleine-KönigJassiBrar
authored andcommitted
mailbox: mtk-cmdq: 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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
1 parent bf562bc commit e89c7c3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/mailbox/mtk-cmdq-mailbox.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static int cmdq_resume(struct device *dev)
367367
return 0;
368368
}
369369

370-
static int cmdq_remove(struct platform_device *pdev)
370+
static void cmdq_remove(struct platform_device *pdev)
371371
{
372372
struct cmdq *cmdq = platform_get_drvdata(pdev);
373373

@@ -378,7 +378,6 @@ static int cmdq_remove(struct platform_device *pdev)
378378
cmdq_runtime_suspend(&pdev->dev);
379379

380380
clk_bulk_unprepare(cmdq->pdata->gce_num, cmdq->clocks);
381-
return 0;
382381
}
383382

384383
static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data)
@@ -761,7 +760,7 @@ static const struct of_device_id cmdq_of_ids[] = {
761760

762761
static struct platform_driver cmdq_drv = {
763762
.probe = cmdq_probe,
764-
.remove = cmdq_remove,
763+
.remove_new = cmdq_remove,
765764
.driver = {
766765
.name = "mtk_cmdq",
767766
.pm = &cmdq_pm_ops,

0 commit comments

Comments
 (0)