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

Configure Feed

Select the types of activity you want to include in your feed.

phy: ti: phy-j721e-wiz: 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-29-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Uwe Kleine-König and committed by
Vinod Koul
db850ea9 13e1f735

+2 -4
+2 -4
drivers/phy/ti/phy-j721e-wiz.c
··· 1636 1636 return ret; 1637 1637 } 1638 1638 1639 - static int wiz_remove(struct platform_device *pdev) 1639 + static void wiz_remove(struct platform_device *pdev) 1640 1640 { 1641 1641 struct device *dev = &pdev->dev; 1642 1642 struct device_node *node = dev->of_node; ··· 1650 1650 wiz_clock_cleanup(wiz, node); 1651 1651 pm_runtime_put(dev); 1652 1652 pm_runtime_disable(dev); 1653 - 1654 - return 0; 1655 1653 } 1656 1654 1657 1655 static struct platform_driver wiz_driver = { 1658 1656 .probe = wiz_probe, 1659 - .remove = wiz_remove, 1657 + .remove_new = wiz_remove, 1660 1658 .driver = { 1661 1659 .name = "wiz", 1662 1660 .of_match_table = wiz_id_table,