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

phy: qualcomm: phy-qcom-eusb2-repeater: 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/20230307115900.2293120-14-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Uwe Kleine-König and committed by
Vinod Koul
e5ce6d9d 64299241

+3 -5
+3 -5
drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
··· 223 223 return 0; 224 224 } 225 225 226 - static int eusb2_repeater_remove(struct platform_device *pdev) 226 + static void eusb2_repeater_remove(struct platform_device *pdev) 227 227 { 228 228 struct eusb2_repeater *rptr = platform_get_drvdata(pdev); 229 229 230 230 if (!rptr) 231 - return 0; 231 + return; 232 232 233 233 eusb2_repeater_exit(rptr->phy); 234 - 235 - return 0; 236 234 } 237 235 238 236 static const struct of_device_id eusb2_repeater_of_match_table[] = { ··· 244 246 245 247 static struct platform_driver eusb2_repeater_driver = { 246 248 .probe = eusb2_repeater_probe, 247 - .remove = eusb2_repeater_remove, 249 + .remove_new = eusb2_repeater_remove, 248 250 .driver = { 249 251 .name = "qcom-eusb2-repeater", 250 252 .of_match_table = eusb2_repeater_of_match_table,