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-dm816x-usb: 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-28-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

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

+2 -4
+2 -4
drivers/phy/ti/phy-dm816x-usb.c
··· 257 257 return error; 258 258 } 259 259 260 - static int dm816x_usb_phy_remove(struct platform_device *pdev) 260 + static void dm816x_usb_phy_remove(struct platform_device *pdev) 261 261 { 262 262 struct dm816x_usb_phy *phy = platform_get_drvdata(pdev); 263 263 264 264 usb_remove_phy(&phy->phy); 265 265 pm_runtime_disable(phy->dev); 266 266 clk_unprepare(phy->refclk); 267 - 268 - return 0; 269 267 } 270 268 271 269 static struct platform_driver dm816x_usb_phy_driver = { 272 270 .probe = dm816x_usb_phy_probe, 273 - .remove = dm816x_usb_phy_remove, 271 + .remove_new = dm816x_usb_phy_remove, 274 272 .driver = { 275 273 .name = "dm816x-usb-phy", 276 274 .pm = &dm816x_usb_phy_pm_ops,