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: sunbpp: 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/f0372246783c7eebb859f82b4b23a9ae25b0adf1.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
813f008d adf4e105

+2 -4
+2 -4
drivers/parport/parport_sunbpp.c
··· 334 334 return err; 335 335 } 336 336 337 - static int bpp_remove(struct platform_device *op) 337 + static void bpp_remove(struct platform_device *op) 338 338 { 339 339 struct parport *p = dev_get_drvdata(&op->dev); 340 340 struct parport_operations *ops = p->ops; ··· 351 351 kfree(ops); 352 352 353 353 dev_set_drvdata(&op->dev, NULL); 354 - 355 - return 0; 356 354 } 357 355 358 356 static const struct of_device_id bpp_match[] = { ··· 368 370 .of_match_table = bpp_match, 369 371 }, 370 372 .probe = bpp_probe, 371 - .remove = bpp_remove, 373 + .remove_new = bpp_remove, 372 374 }; 373 375 374 376 module_platform_driver(bpp_sbus_driver);