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

usb: phy: ab8500: 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/20230319092428.283054-2-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
fe70f2c8 fcd3f508

+2 -4
+2 -4
drivers/usb/phy/phy-ab8500-usb.c
··· 965 965 return 0; 966 966 } 967 967 968 - static int ab8500_usb_remove(struct platform_device *pdev) 968 + static void ab8500_usb_remove(struct platform_device *pdev) 969 969 { 970 970 struct ab8500_usb *ab = platform_get_drvdata(pdev); 971 971 ··· 977 977 ab8500_usb_host_phy_dis(ab); 978 978 else if (ab->mode == USB_PERIPHERAL) 979 979 ab8500_usb_peri_phy_dis(ab); 980 - 981 - return 0; 982 980 } 983 981 984 982 static const struct platform_device_id ab8500_usb_devtype[] = { ··· 987 989 988 990 static struct platform_driver ab8500_usb_driver = { 989 991 .probe = ab8500_usb_probe, 990 - .remove = ab8500_usb_remove, 992 + .remove_new = ab8500_usb_remove, 991 993 .id_table = ab8500_usb_devtype, 992 994 .driver = { 993 995 .name = "abx5x0-usb",