Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -4
+2 -4
drivers/soc/fujitsu/a64fx-diag.c
··· 116 116 return 0; 117 117 } 118 118 119 - static int a64fx_diag_remove(struct platform_device *pdev) 119 + static void a64fx_diag_remove(struct platform_device *pdev) 120 120 { 121 121 struct a64fx_diag_priv *priv = platform_get_drvdata(pdev); 122 122 ··· 127 127 free_nmi(priv->irq, NULL); 128 128 else 129 129 free_irq(priv->irq, NULL); 130 - 131 - return 0; 132 130 } 133 131 134 132 static const struct acpi_device_id a64fx_diag_acpi_match[] = { ··· 142 144 .acpi_match_table = ACPI_PTR(a64fx_diag_acpi_match), 143 145 }, 144 146 .probe = a64fx_diag_probe, 145 - .remove = a64fx_diag_remove, 147 + .remove_new = a64fx_diag_remove, 146 148 }; 147 149 148 150 module_platform_driver(a64fx_diag_driver);