mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:46:16 +00:00
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>
This commit is contained in:
parent
c5c76d800a
commit
2348918407
@ -459,14 +459,13 @@ static int bt_bmc_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bt_bmc_remove(struct platform_device *pdev)
|
||||
static void bt_bmc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct bt_bmc *bt_bmc = dev_get_drvdata(&pdev->dev);
|
||||
|
||||
misc_deregister(&bt_bmc->miscdev);
|
||||
if (bt_bmc->irq < 0)
|
||||
del_timer_sync(&bt_bmc->poll_timer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id bt_bmc_match[] = {
|
||||
@ -482,7 +481,7 @@ static struct platform_driver bt_bmc_driver = {
|
||||
.of_match_table = bt_bmc_match,
|
||||
},
|
||||
.probe = bt_bmc_probe,
|
||||
.remove = bt_bmc_remove,
|
||||
.remove_new = bt_bmc_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(bt_bmc_driver);
|
||||
|
Loading…
Reference in New Issue
Block a user