Skip to content

Commit cb020bf

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
usb: musb: omap2430: 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 (mostly) ignored 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. 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/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e6547b5 commit cb020bf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/usb/musb/omap2430.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,14 +471,12 @@ static int omap2430_probe(struct platform_device *pdev)
471471
return ret;
472472
}
473473

474-
static int omap2430_remove(struct platform_device *pdev)
474+
static void omap2430_remove(struct platform_device *pdev)
475475
{
476476
struct omap2430_glue *glue = platform_get_drvdata(pdev);
477477

478478
platform_device_unregister(glue->musb);
479479
pm_runtime_disable(glue->dev);
480-
481-
return 0;
482480
}
483481

484482
#ifdef CONFIG_PM
@@ -610,7 +608,7 @@ MODULE_DEVICE_TABLE(of, omap2430_id_table);
610608

611609
static struct platform_driver omap2430_driver = {
612610
.probe = omap2430_probe,
613-
.remove = omap2430_remove,
611+
.remove_new = omap2430_remove,
614612
.driver = {
615613
.name = "musb-omap2430",
616614
.pm = DEV_PM_OPS,

0 commit comments

Comments
 (0)