Skip to content

Commit ba6985e

Browse files
Uwe Kleine-Königchanwoochoi
authored andcommitted
extcon: max3355: 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. Link: https://lore.kernel.org/lkml/2c017ea490f721646bd472e7d427eb377e4e8423.1708876186.git.u.kleine-koenig@pengutronix.de/ Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent 6d472f2 commit ba6985e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/extcon/extcon-max3355.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ static int max3355_probe(struct platform_device *pdev)
112112
return 0;
113113
}
114114

115-
static int max3355_remove(struct platform_device *pdev)
115+
static void max3355_remove(struct platform_device *pdev)
116116
{
117117
struct max3355_data *data = platform_get_drvdata(pdev);
118118

119119
gpiod_set_value_cansleep(data->shdn_gpiod, 0);
120-
121-
return 0;
122120
}
123121

124122
static const struct of_device_id max3355_match_table[] = {
@@ -129,7 +127,7 @@ MODULE_DEVICE_TABLE(of, max3355_match_table);
129127

130128
static struct platform_driver max3355_driver = {
131129
.probe = max3355_probe,
132-
.remove = max3355_remove,
130+
.remove_new = max3355_remove,
133131
.driver = {
134132
.name = "extcon-max3355",
135133
.of_match_table = max3355_match_table,

0 commit comments

Comments
 (0)