Skip to content

Commit a6992a0

Browse files
Uwe Kleine-Königlinusw
authored andcommitted
pinctrl: single: 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: Linus Walleij <[email protected]>
1 parent 9725877 commit a6992a0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pinctrl/pinctrl-single.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,13 +1925,11 @@ static int pcs_probe(struct platform_device *pdev)
19251925
return ret;
19261926
}
19271927

1928-
static int pcs_remove(struct platform_device *pdev)
1928+
static void pcs_remove(struct platform_device *pdev)
19291929
{
19301930
struct pcs_device *pcs = platform_get_drvdata(pdev);
19311931

19321932
pcs_free_resources(pcs);
1933-
1934-
return 0;
19351933
}
19361934

19371935
static const struct pcs_soc_data pinctrl_single_omap_wkup = {
@@ -1979,7 +1977,7 @@ MODULE_DEVICE_TABLE(of, pcs_of_match);
19791977

19801978
static struct platform_driver pcs_driver = {
19811979
.probe = pcs_probe,
1982-
.remove = pcs_remove,
1980+
.remove_new = pcs_remove,
19831981
.driver = {
19841982
.name = DRIVER_NAME,
19851983
.of_match_table = pcs_of_match,

0 commit comments

Comments
 (0)