Skip to content

Commit 9365055

Browse files
Uwe Kleine-Königlinusw
authored andcommitted
pinctrl: ti: ti-iodelay: 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-21-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent a80252e commit 9365055

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/pinctrl/ti/pinctrl-ti-iodelay.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,8 @@ static int ti_iodelay_probe(struct platform_device *pdev)
896896
/**
897897
* ti_iodelay_remove() - standard remove
898898
* @pdev: platform device
899-
*
900-
* Return: 0 if all went fine, else appropriate error value.
901899
*/
902-
static int ti_iodelay_remove(struct platform_device *pdev)
900+
static void ti_iodelay_remove(struct platform_device *pdev)
903901
{
904902
struct ti_iodelay_device *iod = platform_get_drvdata(pdev);
905903

@@ -909,13 +907,11 @@ static int ti_iodelay_remove(struct platform_device *pdev)
909907
ti_iodelay_pinconf_deinit_dev(iod);
910908

911909
/* Expect other allocations to be freed by devm */
912-
913-
return 0;
914910
}
915911

916912
static struct platform_driver ti_iodelay_driver = {
917913
.probe = ti_iodelay_probe,
918-
.remove = ti_iodelay_remove,
914+
.remove_new = ti_iodelay_remove,
919915
.driver = {
920916
.name = DRIVER_NAME,
921917
.of_match_table = ti_iodelay_of_match,

0 commit comments

Comments
 (0)