Skip to content

Commit c49de54

Browse files
Uwe Kleine-Königvinodkoul
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent b9251e6 commit c49de54

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/phy/freescale/phy-fsl-samsung-hdmi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,9 @@ static int fsl_samsung_hdmi_phy_probe(struct platform_device *pdev)
657657
return ret;
658658
}
659659

660-
static int fsl_samsung_hdmi_phy_remove(struct platform_device *pdev)
660+
static void fsl_samsung_hdmi_phy_remove(struct platform_device *pdev)
661661
{
662662
of_clk_del_provider(pdev->dev.of_node);
663-
664-
return 0;
665663
}
666664

667665
static int __maybe_unused fsl_samsung_hdmi_phy_suspend(struct device *dev)
@@ -706,7 +704,7 @@ MODULE_DEVICE_TABLE(of, fsl_samsung_hdmi_phy_of_match);
706704

707705
static struct platform_driver fsl_samsung_hdmi_phy_driver = {
708706
.probe = fsl_samsung_hdmi_phy_probe,
709-
.remove = fsl_samsung_hdmi_phy_remove,
707+
.remove_new = fsl_samsung_hdmi_phy_remove,
710708
.driver = {
711709
.name = "fsl-samsung-hdmi-phy",
712710
.of_match_table = fsl_samsung_hdmi_phy_of_match,

0 commit comments

Comments
 (0)