tty: amiserial: 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.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/f2ad92c97086c42dab23cdb165d9f978bbf3d3b5.1708246007.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Uwe Kleine-König 2024-02-18 09:53:54 +01:00 committed by Greg Kroah-Hartman
parent 36d97cdaf4
commit d4c22ec3fc

View File

@ -1566,7 +1566,7 @@ static int __init amiga_serial_probe(struct platform_device *pdev)
return error;
}
static int __exit amiga_serial_remove(struct platform_device *pdev)
static void __exit amiga_serial_remove(struct platform_device *pdev)
{
struct serial_state *state = platform_get_drvdata(pdev);
@ -1576,12 +1576,10 @@ static int __exit amiga_serial_remove(struct platform_device *pdev)
free_irq(IRQ_AMIGA_TBE, state);
free_irq(IRQ_AMIGA_RBF, state);
return 0;
}
static struct platform_driver amiga_serial_driver = {
.remove = __exit_p(amiga_serial_remove),
.remove_new = __exit_p(amiga_serial_remove),
.driver = {
.name = "amiga-serial",
},