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

staging: emxx_udc: 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>
Link: https://lore.kernel.org/r/20230403154014.2564054-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
68c8e9ff 63b2af49

+2 -4
+2 -4
drivers/staging/emxx_udc/emxx_udc.c
··· 3137 3137 } 3138 3138 3139 3139 /*-------------------------------------------------------------------------*/ 3140 - static int nbu2ss_drv_remove(struct platform_device *pdev) 3140 + static void nbu2ss_drv_remove(struct platform_device *pdev) 3141 3141 { 3142 3142 struct nbu2ss_udc *udc; 3143 3143 struct nbu2ss_ep *ep; ··· 3154 3154 3155 3155 /* Interrupt Handler - Release */ 3156 3156 free_irq(vbus_irq, udc); 3157 - 3158 - return 0; 3159 3157 } 3160 3158 3161 3159 /*-------------------------------------------------------------------------*/ ··· 3208 3210 static struct platform_driver udc_driver = { 3209 3211 .probe = nbu2ss_drv_probe, 3210 3212 .shutdown = nbu2ss_drv_shutdown, 3211 - .remove = nbu2ss_drv_remove, 3213 + .remove_new = nbu2ss_drv_remove, 3212 3214 .suspend = nbu2ss_drv_suspend, 3213 3215 .resume = nbu2ss_drv_resume, 3214 3216 .driver = {