Skip to content

Commit aa846a2

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
usb: musb: musb_core: 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 37e7750 commit aa846a2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/usb/musb/musb_core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,7 +2621,7 @@ static int musb_probe(struct platform_device *pdev)
26212621
return musb_init_controller(dev, irq, base);
26222622
}
26232623

2624-
static int musb_remove(struct platform_device *pdev)
2624+
static void musb_remove(struct platform_device *pdev)
26252625
{
26262626
struct device *dev = &pdev->dev;
26272627
struct musb *musb = dev_to_musb(dev);
@@ -2657,7 +2657,6 @@ static int musb_remove(struct platform_device *pdev)
26572657
usb_phy_shutdown(musb->xceiv);
26582658
musb_free(musb);
26592659
device_init_wakeup(dev, 0);
2660-
return 0;
26612660
}
26622661

26632662
#ifdef CONFIG_PM
@@ -2955,7 +2954,7 @@ static struct platform_driver musb_driver = {
29552954
.dev_groups = musb_groups,
29562955
},
29572956
.probe = musb_probe,
2958-
.remove = musb_remove,
2957+
.remove_new = musb_remove,
29592958
};
29602959

29612960
module_platform_driver(musb_driver);

0 commit comments

Comments
 (0)