Skip to content

Commit a304b56

Browse files
Uwe Kleine-Königlinusw
authored andcommitted
pinctrl: nomadik: abx500: 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 9eb9564 commit a304b56

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/pinctrl/nomadik/pinctrl-abx500.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,12 +1079,11 @@ static int abx500_gpio_probe(struct platform_device *pdev)
10791079
* abx500_gpio_remove() - remove Ab8500-gpio driver
10801080
* @pdev: Platform device registered
10811081
*/
1082-
static int abx500_gpio_remove(struct platform_device *pdev)
1082+
static void abx500_gpio_remove(struct platform_device *pdev)
10831083
{
10841084
struct abx500_pinctrl *pct = platform_get_drvdata(pdev);
10851085

10861086
gpiochip_remove(&pct->chip);
1087-
return 0;
10881087
}
10891088

10901089
static struct platform_driver abx500_gpio_driver = {
@@ -1093,7 +1092,7 @@ static struct platform_driver abx500_gpio_driver = {
10931092
.of_match_table = abx500_gpio_match,
10941093
},
10951094
.probe = abx500_gpio_probe,
1096-
.remove = abx500_gpio_remove,
1095+
.remove_new = abx500_gpio_remove,
10971096
};
10981097

10991098
static int __init abx500_gpio_init(void)

0 commit comments

Comments
 (0)