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

Configure Feed

Select the types of activity you want to include in your feed.

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 <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/75b3b8f498d6079c974bd47c763c589b9d2c00f6.1702933181.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
adf4e105 832c17b8

+2 -3
+2 -3
drivers/parport/parport_amiga.c
··· 219 219 return err; 220 220 } 221 221 222 - static int __exit amiga_parallel_remove(struct platform_device *pdev) 222 + static void __exit amiga_parallel_remove(struct platform_device *pdev) 223 223 { 224 224 struct parport *port = platform_get_drvdata(pdev); 225 225 ··· 227 227 if (port->irq != PARPORT_IRQ_NONE) 228 228 free_irq(IRQ_AMIGA_CIAA_FLG, port); 229 229 parport_put_port(port); 230 - return 0; 231 230 } 232 231 233 232 static struct platform_driver amiga_parallel_driver = { 234 - .remove = __exit_p(amiga_parallel_remove), 233 + .remove_new = __exit_p(amiga_parallel_remove), 235 234 .driver = { 236 235 .name = "amiga-parallel", 237 236 },