From a25e745c752a0aa197296c0a6405255f19813b4b Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 25 Sep 2023 11:55:01 +0200 Subject: soc/ixp4xx: ixp4xx-npe: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- drivers/soc/ixp4xx/ixp4xx-npe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/soc') 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); -- cgit