From 830d1151f91885aad30826b1968a376906f28a8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Sun, 26 Mar 2023 16:32:06 +0200 Subject: [PATCH] media: radio-si476x: 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/radio/radio-si476x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c index 171f9cc..6061506 100644 --- a/drivers/media/radio/radio-si476x.c +++ b/drivers/media/radio/radio-si476x.c @@ -1498,7 +1498,7 @@ exit: return rval; } -static int si476x_radio_remove(struct platform_device *pdev) +static void si476x_radio_remove(struct platform_device *pdev) { struct si476x_radio *radio = platform_get_drvdata(pdev); @@ -1506,8 +1506,6 @@ static int si476x_radio_remove(struct platform_device *pdev) video_unregister_device(&radio->videodev); v4l2_device_unregister(&radio->v4l2dev); debugfs_remove_recursive(radio->debugfs); - - return 0; } MODULE_ALIAS("platform:si476x-radio"); @@ -1517,7 +1515,7 @@ static struct platform_driver si476x_radio_driver = { .name = DRIVER_NAME, }, .probe = si476x_radio_probe, - .remove = si476x_radio_remove, + .remove_new = si476x_radio_remove, }; module_platform_driver(si476x_radio_driver); -- 2.7.4