Skip to content

Commit adf4e10

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
parport: amiga: 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 <[email protected]> Link: https://lore.kernel.org/r/75b3b8f498d6079c974bd47c763c589b9d2c00f6.1702933181.git.u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 832c17b commit adf4e10

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/parport/parport_amiga.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,19 +219,18 @@ static int __init amiga_parallel_probe(struct platform_device *pdev)
219219
return err;
220220
}
221221

222-
static int __exit amiga_parallel_remove(struct platform_device *pdev)
222+
static void __exit amiga_parallel_remove(struct platform_device *pdev)
223223
{
224224
struct parport *port = platform_get_drvdata(pdev);
225225

226226
parport_remove_port(port);
227227
if (port->irq != PARPORT_IRQ_NONE)
228228
free_irq(IRQ_AMIGA_CIAA_FLG, port);
229229
parport_put_port(port);
230-
return 0;
231230
}
232231

233232
static struct platform_driver amiga_parallel_driver = {
234-
.remove = __exit_p(amiga_parallel_remove),
233+
.remove_new = __exit_p(amiga_parallel_remove),
235234
.driver = {
236235
.name = "amiga-parallel",
237236
},

0 commit comments

Comments
 (0)