Skip to content

Commit 6d472f2

Browse files
Uwe Kleine-Königchanwoochoi
authored andcommitted
extcon: intel-mrfld: 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/7223e19152980ef553e38cf56c2b38ec099586e0.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 67d4b2c commit 6d472f2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/extcon/extcon-intel-mrfld.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,11 @@ static int mrfld_extcon_probe(struct platform_device *pdev)
257257
return 0;
258258
}
259259

260-
static int mrfld_extcon_remove(struct platform_device *pdev)
260+
static void mrfld_extcon_remove(struct platform_device *pdev)
261261
{
262262
struct mrfld_extcon_data *data = platform_get_drvdata(pdev);
263263

264264
mrfld_extcon_sw_control(data, false);
265-
266-
return 0;
267265
}
268266

269267
static const struct platform_device_id mrfld_extcon_id_table[] = {
@@ -277,7 +275,7 @@ static struct platform_driver mrfld_extcon_driver = {
277275
.name = "mrfld_bcove_pwrsrc",
278276
},
279277
.probe = mrfld_extcon_probe,
280-
.remove = mrfld_extcon_remove,
278+
.remove_new = mrfld_extcon_remove,
281279
.id_table = mrfld_extcon_id_table,
282280
};
283281
module_platform_driver(mrfld_extcon_driver);

0 commit comments

Comments
 (0)