Skip to content

Commit 8000540

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

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/usb/musb/ux500.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,12 @@ static int ux500_probe(struct platform_device *pdev)
303303
return ret;
304304
}
305305

306-
static int ux500_remove(struct platform_device *pdev)
306+
static void ux500_remove(struct platform_device *pdev)
307307
{
308308
struct ux500_glue *glue = platform_get_drvdata(pdev);
309309

310310
platform_device_unregister(glue->musb);
311311
clk_disable_unprepare(glue->clk);
312-
313-
return 0;
314312
}
315313

316314
#ifdef CONFIG_PM_SLEEP
@@ -357,7 +355,7 @@ MODULE_DEVICE_TABLE(of, ux500_match);
357355

358356
static struct platform_driver ux500_driver = {
359357
.probe = ux500_probe,
360-
.remove = ux500_remove,
358+
.remove_new = ux500_remove,
361359
.driver = {
362360
.name = "musb-ux500",
363361
.pm = &ux500_pm_ops,

0 commit comments

Comments
 (0)