Skip to content

Commit 969c952

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
usb: musb: tusb6010: 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 2a21ace commit 969c952

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/usb/musb/tusb6010.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,19 +1258,17 @@ static int tusb_probe(struct platform_device *pdev)
12581258
return 0;
12591259
}
12601260

1261-
static int tusb_remove(struct platform_device *pdev)
1261+
static void tusb_remove(struct platform_device *pdev)
12621262
{
12631263
struct tusb6010_glue *glue = platform_get_drvdata(pdev);
12641264

12651265
platform_device_unregister(glue->musb);
12661266
usb_phy_generic_unregister(glue->phy);
1267-
1268-
return 0;
12691267
}
12701268

12711269
static struct platform_driver tusb_driver = {
12721270
.probe = tusb_probe,
1273-
.remove = tusb_remove,
1271+
.remove_new = tusb_remove,
12741272
.driver = {
12751273
.name = "musb-tusb",
12761274
},

0 commit comments

Comments
 (0)