Skip to content

Commit 9eb9564

Browse files
Uwe Kleine-Königlinusw
authored andcommitted
pinctrl: cirrus: madera-core: 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: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 88b3f10 commit 9eb9564

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pinctrl/cirrus/pinctrl-madera-core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,19 +1084,17 @@ static int madera_pin_probe(struct platform_device *pdev)
10841084
return 0;
10851085
}
10861086

1087-
static int madera_pin_remove(struct platform_device *pdev)
1087+
static void madera_pin_remove(struct platform_device *pdev)
10881088
{
10891089
struct madera_pin_private *priv = platform_get_drvdata(pdev);
10901090

10911091
if (priv->madera->pdata.gpio_configs)
10921092
pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs);
1093-
1094-
return 0;
10951093
}
10961094

10971095
static struct platform_driver madera_pin_driver = {
10981096
.probe = madera_pin_probe,
1099-
.remove = madera_pin_remove,
1097+
.remove_new = madera_pin_remove,
11001098
.driver = {
11011099
.name = "madera-pinctrl",
11021100
},

0 commit comments

Comments
 (0)