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

media: stm32-dcmi: 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
65becc29 41579d57

+2 -4
+2 -4
drivers/media/platform/st/stm32/stm32-dcmi.c
··· 2135 2135 return ret; 2136 2136 } 2137 2137 2138 - static int dcmi_remove(struct platform_device *pdev) 2138 + static void dcmi_remove(struct platform_device *pdev) 2139 2139 { 2140 2140 struct stm32_dcmi *dcmi = platform_get_drvdata(pdev); 2141 2141 ··· 2148 2148 media_device_cleanup(&dcmi->mdev); 2149 2149 2150 2150 dma_release_channel(dcmi->dma_chan); 2151 - 2152 - return 0; 2153 2151 } 2154 2152 2155 2153 static __maybe_unused int dcmi_runtime_suspend(struct device *dev) ··· 2201 2203 2202 2204 static struct platform_driver stm32_dcmi_driver = { 2203 2205 .probe = dcmi_probe, 2204 - .remove = dcmi_remove, 2206 + .remove_new = dcmi_remove, 2205 2207 .driver = { 2206 2208 .name = DRV_NAME, 2207 2209 .of_match_table = of_match_ptr(stm32_dcmi_of_match),