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

authored by

Uwe Kleine-König and committed by
Vinod Koul
cb1161c0 497a3832

+2 -4
+2 -4
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
··· 1246 1246 return PTR_ERR_OR_ZERO(phy_provider); 1247 1247 } 1248 1248 1249 - static int inno_hdmi_phy_remove(struct platform_device *pdev) 1249 + static void inno_hdmi_phy_remove(struct platform_device *pdev) 1250 1250 { 1251 1251 of_clk_del_provider(pdev->dev.of_node); 1252 - 1253 - return 0; 1254 1252 } 1255 1253 1256 1254 static const struct of_device_id inno_hdmi_phy_of_match[] = { ··· 1264 1266 1265 1267 static struct platform_driver inno_hdmi_phy_driver = { 1266 1268 .probe = inno_hdmi_phy_probe, 1267 - .remove = inno_hdmi_phy_remove, 1269 + .remove_new = inno_hdmi_phy_remove, 1268 1270 .driver = { 1269 1271 .name = "inno-hdmi-phy", 1270 1272 .of_match_table = inno_hdmi_phy_of_match,