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

Commit 999dff3

Browse files
Uwe Kleine-Königcminyard
authored andcommitted
ipmi: kcs_bmc_npcm7xx: 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: <16144ffaa6f40a1a126d5cf19ef4337218a04fbb.1709655755.git.u.kleine-koenig@pengutronix.de> Signed-off-by: Corey Minyard <minyard@acm.org>
1 parent c61090f commit 999dff3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/char/ipmi/kcs_bmc_npcm7xx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static int npcm7xx_kcs_probe(struct platform_device *pdev)
218218
return 0;
219219
}
220220

221-
static int npcm7xx_kcs_remove(struct platform_device *pdev)
221+
static void npcm7xx_kcs_remove(struct platform_device *pdev)
222222
{
223223
struct npcm7xx_kcs_bmc *priv = platform_get_drvdata(pdev);
224224
struct kcs_bmc_device *kcs_bmc = &priv->kcs_bmc;
@@ -227,8 +227,6 @@ static int npcm7xx_kcs_remove(struct platform_device *pdev)
227227

228228
npcm7xx_kcs_enable_channel(kcs_bmc, false);
229229
npcm7xx_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE), 0);
230-
231-
return 0;
232230
}
233231

234232
static const struct of_device_id npcm_kcs_bmc_match[] = {
@@ -243,7 +241,7 @@ static struct platform_driver npcm_kcs_bmc_driver = {
243241
.of_match_table = npcm_kcs_bmc_match,
244242
},
245243
.probe = npcm7xx_kcs_probe,
246-
.remove = npcm7xx_kcs_remove,
244+
.remove_new = npcm7xx_kcs_remove,
247245
};
248246
module_platform_driver(npcm_kcs_bmc_driver);
249247

0 commit comments

Comments
 (0)