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

media: m2m-deinterlace: 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
c65cee0b 3c56717a

+2 -4
+2 -4
drivers/media/platform/m2m-deinterlace.c
··· 984 984 return ret; 985 985 } 986 986 987 - static int deinterlace_remove(struct platform_device *pdev) 987 + static void deinterlace_remove(struct platform_device *pdev) 988 988 { 989 989 struct deinterlace_dev *pcdev = platform_get_drvdata(pdev); 990 990 ··· 993 993 video_unregister_device(&pcdev->vfd); 994 994 v4l2_device_unregister(&pcdev->v4l2_dev); 995 995 dma_release_channel(pcdev->dma_chan); 996 - 997 - return 0; 998 996 } 999 997 1000 998 static struct platform_driver deinterlace_pdrv = { 1001 999 .probe = deinterlace_probe, 1002 - .remove = deinterlace_remove, 1000 + .remove_new = deinterlace_remove, 1003 1001 .driver = { 1004 1002 .name = MEM2MEM_NAME, 1005 1003 },