Skip to content

Commit 7dcb866

Browse files
Uwe Kleine-Königvinodkoul
authored andcommitted
phy: xilinx: 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]> Acked-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/57a3338a1cec683ac84d48e00dbf197e15ee5481.1709886922.git.u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul <[email protected]>
1 parent 9b6bfad commit 7dcb866

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/phy/xilinx/phy-zynqmp.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,15 +995,13 @@ static int xpsgtr_probe(struct platform_device *pdev)
995995
return 0;
996996
}
997997

998-
static int xpsgtr_remove(struct platform_device *pdev)
998+
static void xpsgtr_remove(struct platform_device *pdev)
999999
{
10001000
struct xpsgtr_dev *gtr_dev = platform_get_drvdata(pdev);
10011001

10021002
pm_runtime_disable(gtr_dev->dev);
10031003
pm_runtime_put_noidle(gtr_dev->dev);
10041004
pm_runtime_set_suspended(gtr_dev->dev);
1005-
1006-
return 0;
10071005
}
10081006

10091007
static const struct of_device_id xpsgtr_of_match[] = {
@@ -1015,7 +1013,7 @@ MODULE_DEVICE_TABLE(of, xpsgtr_of_match);
10151013

10161014
static struct platform_driver xpsgtr_driver = {
10171015
.probe = xpsgtr_probe,
1018-
.remove = xpsgtr_remove,
1016+
.remove_new = xpsgtr_remove,
10191017
.driver = {
10201018
.name = "xilinx-psgtr",
10211019
.of_match_table = xpsgtr_of_match,

0 commit comments

Comments
 (0)