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

phy: renesas: r8a779f0-ether-serdes: 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-19-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Uwe Kleine-König and committed by
Vinod Koul
f1c01b91 8e593a22

+2 -4
+2 -4
drivers/phy/renesas/r8a779f0-ether-serdes.c
··· 388 388 return 0; 389 389 } 390 390 391 - static int r8a779f0_eth_serdes_remove(struct platform_device *pdev) 391 + static void r8a779f0_eth_serdes_remove(struct platform_device *pdev) 392 392 { 393 393 pm_runtime_put(&pdev->dev); 394 394 pm_runtime_disable(&pdev->dev); 395 395 396 396 platform_set_drvdata(pdev, NULL); 397 - 398 - return 0; 399 397 } 400 398 401 399 static struct platform_driver r8a779f0_eth_serdes_driver_platform = { 402 400 .probe = r8a779f0_eth_serdes_probe, 403 - .remove = r8a779f0_eth_serdes_remove, 401 + .remove_new = r8a779f0_eth_serdes_remove, 404 402 .driver = { 405 403 .name = "r8a779f0_eth_serdes", 406 404 .of_match_table = r8a779f0_eth_serdes_of_table,