Skip to content

Commit e6547b5

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

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/usb/musb/musb_dsps.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,16 +915,14 @@ static int dsps_probe(struct platform_device *pdev)
915915
return ret;
916916
}
917917

918-
static int dsps_remove(struct platform_device *pdev)
918+
static void dsps_remove(struct platform_device *pdev)
919919
{
920920
struct dsps_glue *glue = platform_get_drvdata(pdev);
921921

922922
platform_device_unregister(glue->musb);
923923

924924
pm_runtime_disable(&pdev->dev);
925925
iounmap(glue->usbss_base);
926-
927-
return 0;
928926
}
929927

930928
static const struct dsps_musb_wrapper am33xx_driver_data = {
@@ -1036,7 +1034,7 @@ static SIMPLE_DEV_PM_OPS(dsps_pm_ops, dsps_suspend, dsps_resume);
10361034

10371035
static struct platform_driver dsps_usbss_driver = {
10381036
.probe = dsps_probe,
1039-
.remove = dsps_remove,
1037+
.remove_new = dsps_remove,
10401038
.driver = {
10411039
.name = "musb-dsps",
10421040
.pm = &dsps_pm_ops,

0 commit comments

Comments
 (0)