Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 2348918

Browse files
Uwe Kleine-Königcminyard
authored andcommitted
ipmi: bt-bmc: 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> Message-Id: <dc5e67fb45c8c673cbf3cdbc4997c5deb3a700fe.1709655755.git.u.kleine-koenig@pengutronix.de> Signed-off-by: Corey Minyard <minyard@acm.org>
1 parent c5c76d8 commit 2348918

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/char/ipmi/bt-bmc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,13 @@ static int bt_bmc_probe(struct platform_device *pdev)
459459
return 0;
460460
}
461461

462-
static int bt_bmc_remove(struct platform_device *pdev)
462+
static void bt_bmc_remove(struct platform_device *pdev)
463463
{
464464
struct bt_bmc *bt_bmc = dev_get_drvdata(&pdev->dev);
465465

466466
misc_deregister(&bt_bmc->miscdev);
467467
if (bt_bmc->irq < 0)
468468
del_timer_sync(&bt_bmc->poll_timer);
469-
return 0;
470469
}
471470

472471
static const struct of_device_id bt_bmc_match[] = {
@@ -482,7 +481,7 @@ static struct platform_driver bt_bmc_driver = {
482481
.of_match_table = bt_bmc_match,
483482
},
484483
.probe = bt_bmc_probe,
485-
.remove = bt_bmc_remove,
484+
.remove_new = bt_bmc_remove,
486485
};
487486

488487
module_platform_driver(bt_bmc_driver);

0 commit comments

Comments
 (0)