Skip to content

Commit f0c3958

Browse files
Uwe Kleine-KönigLinus Walleij
authored andcommitted
pinctrl: as3722: 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 <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231009083856.222030-11-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent b340412 commit f0c3958

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/pinctrl/pinctrl-as3722.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,11 @@ static int as3722_pinctrl_probe(struct platform_device *pdev)
587587
return ret;
588588
}
589589

590-
static int as3722_pinctrl_remove(struct platform_device *pdev)
590+
static void as3722_pinctrl_remove(struct platform_device *pdev)
591591
{
592592
struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev);
593593

594594
gpiochip_remove(&as_pci->gpio_chip);
595-
return 0;
596595
}
597596

598597
static const struct of_device_id as3722_pinctrl_of_match[] = {
@@ -607,7 +606,7 @@ static struct platform_driver as3722_pinctrl_driver = {
607606
.of_match_table = as3722_pinctrl_of_match,
608607
},
609608
.probe = as3722_pinctrl_probe,
610-
.remove = as3722_pinctrl_remove,
609+
.remove_new = as3722_pinctrl_remove,
611610
};
612611
module_platform_driver(as3722_pinctrl_driver);
613612

0 commit comments

Comments
 (0)