diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-03-05 17:26:58 +0100 |
---|---|---|
committer | Corey Minyard <minyard@acm.org> | 2024-04-17 14:55:04 -0500 |
commit | 2348918407a73c3d5e35b09bd39a52ed5d0d6ab2 (patch) | |
tree | 6b2e8099425718aa8c76a16f7d46c31cb8714d4e /drivers/char | |
parent | c5c76d800a646e08890cb775efd6037008136b9e (diff) | |
download | linux-2348918407a73c3d5e35b09bd39a52ed5d0d6ab2.tar.gz linux-2348918407a73c3d5e35b09bd39a52ed5d0d6ab2.tar.bz2 linux-2348918407a73c3d5e35b09bd39a52ed5d0d6ab2.zip |
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>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/bt-bmc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c index 7450904e330a..b8b9c07d3b5d 100644 --- a/drivers/char/ipmi/bt-bmc.c +++ b/drivers/char/ipmi/bt-bmc.c @@ -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); |