soc/fujitsu: a64fx-diag: 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-9-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This commit is contained in:
Uwe Kleine-König 2023-09-25 11:54:59 +02:00
parent ea32155a03
commit 9a9b332db0

View File

@ -116,7 +116,7 @@ static int a64fx_diag_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int a64fx_diag_remove(struct platform_device *pdev) static void a64fx_diag_remove(struct platform_device *pdev)
{ {
struct a64fx_diag_priv *priv = platform_get_drvdata(pdev); struct a64fx_diag_priv *priv = platform_get_drvdata(pdev);
@ -127,8 +127,6 @@ static int a64fx_diag_remove(struct platform_device *pdev)
free_nmi(priv->irq, NULL); free_nmi(priv->irq, NULL);
else else
free_irq(priv->irq, NULL); free_irq(priv->irq, NULL);
return 0;
} }
static const struct acpi_device_id a64fx_diag_acpi_match[] = { static const struct acpi_device_id a64fx_diag_acpi_match[] = {
@ -144,7 +142,7 @@ static struct platform_driver a64fx_diag_driver = {
.acpi_match_table = ACPI_PTR(a64fx_diag_acpi_match), .acpi_match_table = ACPI_PTR(a64fx_diag_acpi_match),
}, },
.probe = a64fx_diag_probe, .probe = a64fx_diag_probe,
.remove = a64fx_diag_remove, .remove_new = a64fx_diag_remove,
}; };
module_platform_driver(a64fx_diag_driver); module_platform_driver(a64fx_diag_driver);