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

usb: phy: tegra: 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-11-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
d95a0ce2 e5c1b349

+2 -4
+2 -4
drivers/usb/phy/phy-tegra-usb.c
··· 1486 1486 return usb_add_phy_dev(&tegra_phy->u_phy); 1487 1487 } 1488 1488 1489 - static int tegra_usb_phy_remove(struct platform_device *pdev) 1489 + static void tegra_usb_phy_remove(struct platform_device *pdev) 1490 1490 { 1491 1491 struct tegra_usb_phy *tegra_phy = platform_get_drvdata(pdev); 1492 1492 1493 1493 usb_remove_phy(&tegra_phy->u_phy); 1494 - 1495 - return 0; 1496 1494 } 1497 1495 1498 1496 static struct platform_driver tegra_usb_phy_driver = { 1499 1497 .probe = tegra_usb_phy_probe, 1500 - .remove = tegra_usb_phy_remove, 1498 + .remove_new = tegra_usb_phy_remove, 1501 1499 .driver = { 1502 1500 .name = "tegra-phy", 1503 1501 .of_match_table = tegra_usb_phy_id_table,