From 0a44e5f60617eeb0aa4e7f75bda3943b448a9845 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Sun, 26 Mar 2023 16:31:56 +0200 Subject: [PATCH] media: omap_vout: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Hans Verkuil --- drivers/media/platform/ti/omap/omap_vout.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/ti/omap/omap_vout.c b/drivers/media/platform/ti/omap/omap_vout.c index 3e0d9af..4143274 100644 --- a/drivers/media/platform/ti/omap/omap_vout.c +++ b/drivers/media/platform/ti/omap/omap_vout.c @@ -1569,7 +1569,7 @@ static void omap_vout_cleanup_device(struct omap_vout_device *vout) kfree(vout); } -static int omap_vout_remove(struct platform_device *pdev) +static void omap_vout_remove(struct platform_device *pdev) { int k; struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev); @@ -1587,7 +1587,6 @@ static int omap_vout_remove(struct platform_device *pdev) omap_dss_put_device(vid_dev->displays[k]); } kfree(vid_dev); - return 0; } static int __init omap_vout_probe(struct platform_device *pdev) @@ -1721,7 +1720,7 @@ static struct platform_driver omap_vout_driver = { .driver = { .name = VOUT_NAME, }, - .remove = omap_vout_remove, + .remove_new = omap_vout_remove, }; static int __init omap_vout_init(void) -- 2.7.4