Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: hva-v4l2: 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 <u.kleine-koenig@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Uwe Kleine-König and committed by
Hans Verkuil
b7186d94 cd9a1c4f

+2 -4
+2 -4
drivers/media/platform/st/sti/hva/hva-v4l2.c
··· 1422 1422 return ret; 1423 1423 } 1424 1424 1425 - static int hva_remove(struct platform_device *pdev) 1425 + static void hva_remove(struct platform_device *pdev) 1426 1426 { 1427 1427 struct hva_dev *hva = platform_get_drvdata(pdev); 1428 1428 struct device *dev = hva_to_dev(hva); ··· 1440 1440 v4l2_device_unregister(&hva->v4l2_dev); 1441 1441 1442 1442 dev_info(dev, "%s %s removed\n", HVA_PREFIX, pdev->name); 1443 - 1444 - return 0; 1445 1443 } 1446 1444 1447 1445 /* PM ops */ ··· 1459 1461 1460 1462 static struct platform_driver hva_driver = { 1461 1463 .probe = hva_probe, 1462 - .remove = hva_remove, 1464 + .remove_new = hva_remove, 1463 1465 .driver = { 1464 1466 .name = HVA_NAME, 1465 1467 .of_match_table = hva_match_types,