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

phy: freescale: fsl-samsung-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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

authored by

Uwe Kleine-König and committed by
Vinod Koul
c49de54c b9251e64

+2 -4
+2 -4
drivers/phy/freescale/phy-fsl-samsung-hdmi.c
··· 657 657 return ret; 658 658 } 659 659 660 - static int fsl_samsung_hdmi_phy_remove(struct platform_device *pdev) 660 + static void fsl_samsung_hdmi_phy_remove(struct platform_device *pdev) 661 661 { 662 662 of_clk_del_provider(pdev->dev.of_node); 663 - 664 - return 0; 665 663 } 666 664 667 665 static int __maybe_unused fsl_samsung_hdmi_phy_suspend(struct device *dev) ··· 704 706 705 707 static struct platform_driver fsl_samsung_hdmi_phy_driver = { 706 708 .probe = fsl_samsung_hdmi_phy_probe, 707 - .remove = fsl_samsung_hdmi_phy_remove, 709 + .remove_new = fsl_samsung_hdmi_phy_remove, 708 710 .driver = { 709 711 .name = "fsl-samsung-hdmi-phy", 710 712 .of_match_table = fsl_samsung_hdmi_phy_of_match,