Skip to content

Commit 60d0642

Browse files
Uwe Kleine-Königkuba-moo
authored andcommitted
ptp: fc3: 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]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 73a42f4 commit 60d0642

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/ptp/ptp_fc3.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,21 +996,19 @@ static int idtfc3_probe(struct platform_device *pdev)
996996
return 0;
997997
}
998998

999-
static int idtfc3_remove(struct platform_device *pdev)
999+
static void idtfc3_remove(struct platform_device *pdev)
10001000
{
10011001
struct idtfc3 *idtfc3 = platform_get_drvdata(pdev);
10021002

10031003
ptp_clock_unregister(idtfc3->ptp_clock);
1004-
1005-
return 0;
10061004
}
10071005

10081006
static struct platform_driver idtfc3_driver = {
10091007
.driver = {
10101008
.name = "rc38xxx-phc",
10111009
},
10121010
.probe = idtfc3_probe,
1013-
.remove = idtfc3_remove,
1011+
.remove_new = idtfc3_remove,
10141012
};
10151013

10161014
module_platform_driver(idtfc3_driver);

0 commit comments

Comments
 (0)