mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-22 12:44:11 +08:00
soc/ixp4xx: ixp4xx-npe: 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/r/20230925095532.1984344-11-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This commit is contained in:
parent
3f40c999de
commit
a25e745c75
@ -736,7 +736,7 @@ static int ixp4xx_npe_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ixp4xx_npe_remove(struct platform_device *pdev)
|
||||
static void ixp4xx_npe_remove(struct platform_device *pdev)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -744,8 +744,6 @@ static int ixp4xx_npe_remove(struct platform_device *pdev)
|
||||
if (npe_tab[i].regs) {
|
||||
npe_reset(&npe_tab[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id ixp4xx_npe_of_match[] = {
|
||||
@ -761,7 +759,7 @@ static struct platform_driver ixp4xx_npe_driver = {
|
||||
.of_match_table = ixp4xx_npe_of_match,
|
||||
},
|
||||
.probe = ixp4xx_npe_probe,
|
||||
.remove = ixp4xx_npe_remove,
|
||||
.remove_new = ixp4xx_npe_remove,
|
||||
};
|
||||
module_platform_driver(ixp4xx_npe_driver);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user