summaryrefslogtreecommitdiff
path: root/drivers/soc/ixp4xx
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-09-25 12:55:01 +0300
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-10-15 00:27:09 +0300
commita25e745c752a0aa197296c0a6405255f19813b4b (patch)
tree7cf55c945e8c69c5c34606eaa1e43534d45ef389 /drivers/soc/ixp4xx
parent3f40c999de39626f67aa36858801ec2906740125 (diff)
downloadlinux-a25e745c752a0aa197296c0a6405255f19813b4b.tar.xz
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>
Diffstat (limited to 'drivers/soc/ixp4xx')
-rw-r--r--drivers/soc/ixp4xx/ixp4xx-npe.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/soc/ixp4xx/ixp4xx-npe.c b/drivers/soc/ixp4xx/ixp4xx-npe.c
index 5be9988f30ce..35825ee95dff 100644
--- a/drivers/soc/ixp4xx/ixp4xx-npe.c
+++ b/drivers/soc/ixp4xx/ixp4xx-npe.c
@@ -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);