Skip to content

Commit 348e148

Browse files
Uwe Kleine-Königlinusw
authored andcommitted
pinctrl: qcom: spmi-gpio: 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 14a1655 commit 348e148

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/pinctrl/qcom/pinctrl-spmi-gpio.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,12 +1185,11 @@ static int pmic_gpio_probe(struct platform_device *pdev)
11851185
return ret;
11861186
}
11871187

1188-
static int pmic_gpio_remove(struct platform_device *pdev)
1188+
static void pmic_gpio_remove(struct platform_device *pdev)
11891189
{
11901190
struct pmic_gpio_state *state = platform_get_drvdata(pdev);
11911191

11921192
gpiochip_remove(&state->chip);
1193-
return 0;
11941193
}
11951194

11961195
static const struct of_device_id pmic_gpio_of_match[] = {
@@ -1265,7 +1264,7 @@ static struct platform_driver pmic_gpio_driver = {
12651264
.of_match_table = pmic_gpio_of_match,
12661265
},
12671266
.probe = pmic_gpio_probe,
1268-
.remove = pmic_gpio_remove,
1267+
.remove_new = pmic_gpio_remove,
12691268
};
12701269

12711270
module_platform_driver(pmic_gpio_driver);

0 commit comments

Comments
 (0)