Skip to content

Commit 232b537

Browse files
Uwe Kleine-Königmartinezjavier
authored andcommitted
drm/mediatek: 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 (mostly) ignored 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. 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]> Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2b9b0a9 commit 232b537

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/mediatek/mtk_cec.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,12 @@ static int mtk_cec_probe(struct platform_device *pdev)
235235
return 0;
236236
}
237237

238-
static int mtk_cec_remove(struct platform_device *pdev)
238+
static void mtk_cec_remove(struct platform_device *pdev)
239239
{
240240
struct mtk_cec *cec = platform_get_drvdata(pdev);
241241

242242
mtk_cec_htplg_irq_disable(cec);
243243
clk_disable_unprepare(cec->clk);
244-
return 0;
245244
}
246245

247246
static const struct of_device_id mtk_cec_of_ids[] = {
@@ -252,7 +251,7 @@ MODULE_DEVICE_TABLE(of, mtk_cec_of_ids);
252251

253252
struct platform_driver mtk_cec_driver = {
254253
.probe = mtk_cec_probe,
255-
.remove = mtk_cec_remove,
254+
.remove_new = mtk_cec_remove,
256255
.driver = {
257256
.name = "mediatek-cec",
258257
.of_match_table = mtk_cec_of_ids,

0 commit comments

Comments
 (0)