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: rockchip: phy-rockchip-typec: 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>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20230307115900.2293120-23-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Uwe Kleine-König and committed by
Vinod Koul
1d558e55 cb1161c0

+2 -4
+2 -4
drivers/phy/rockchip/phy-rockchip-typec.c
··· 1194 1194 return 0; 1195 1195 } 1196 1196 1197 - static int rockchip_typec_phy_remove(struct platform_device *pdev) 1197 + static void rockchip_typec_phy_remove(struct platform_device *pdev) 1198 1198 { 1199 1199 pm_runtime_disable(&pdev->dev); 1200 - 1201 - return 0; 1202 1200 } 1203 1201 1204 1202 static const struct of_device_id rockchip_typec_phy_dt_ids[] = { ··· 1211 1213 1212 1214 static struct platform_driver rockchip_typec_phy_driver = { 1213 1215 .probe = rockchip_typec_phy_probe, 1214 - .remove = rockchip_typec_phy_remove, 1216 + .remove_new = rockchip_typec_phy_remove, 1215 1217 .driver = { 1216 1218 .name = "rockchip-typec-phy", 1217 1219 .of_match_table = rockchip_typec_phy_dt_ids,