Commit 232b5372 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Javier Martinez Canillas

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-29-u.kleine-koenig@pengutronix.de
parent 2b9b0a9f
...@@ -235,13 +235,12 @@ static int mtk_cec_probe(struct platform_device *pdev) ...@@ -235,13 +235,12 @@ static int mtk_cec_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int mtk_cec_remove(struct platform_device *pdev) static void mtk_cec_remove(struct platform_device *pdev)
{ {
struct mtk_cec *cec = platform_get_drvdata(pdev); struct mtk_cec *cec = platform_get_drvdata(pdev);
mtk_cec_htplg_irq_disable(cec); mtk_cec_htplg_irq_disable(cec);
clk_disable_unprepare(cec->clk); clk_disable_unprepare(cec->clk);
return 0;
} }
static const struct of_device_id mtk_cec_of_ids[] = { static const struct of_device_id mtk_cec_of_ids[] = {
...@@ -252,7 +251,7 @@ MODULE_DEVICE_TABLE(of, mtk_cec_of_ids); ...@@ -252,7 +251,7 @@ MODULE_DEVICE_TABLE(of, mtk_cec_of_ids);
struct platform_driver mtk_cec_driver = { struct platform_driver mtk_cec_driver = {
.probe = mtk_cec_probe, .probe = mtk_cec_probe,
.remove = mtk_cec_remove, .remove_new = mtk_cec_remove,
.driver = { .driver = {
.name = "mediatek-cec", .name = "mediatek-cec",
.of_match_table = mtk_cec_of_ids, .of_match_table = mtk_cec_of_ids,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment