Skip to content

Commit

Permalink
usb: dwc3: omap: fix up error path on probe()
Browse files Browse the repository at this point in the history
Even if pm_runtime_get*() fails, we *MUST* call
pm_runtime_put_sync() before disabling PM.

While at it, remove superfluous dwc3_omap_disable_irqs()
in error path.

Signed-off-by: Felipe Balbi <[email protected]>
[[email protected]: patch description updates]
Signed-off-by: Sekhar Nori <[email protected]>
  • Loading branch information
Felipe Balbi authored and nsekhar committed Aug 27, 2015
1 parent 73fe278 commit 1d662b6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
dev_err(dev, "get_sync failed with err %d\n", ret);
goto err0;
goto err1;
}

dwc3_omap_map_offset(omap);
Expand All @@ -554,29 +554,24 @@ static int dwc3_omap_probe(struct platform_device *pdev)

ret = dwc3_omap_extcon_register(omap);
if (ret < 0)
goto err2;
goto err1;

ret = of_platform_populate(node, NULL, NULL, dev);
if (ret) {
dev_err(&pdev->dev, "failed to create dwc3 core\n");
goto err3;
goto err2;
}

return 0;

err3:
err2:
if (omap->extcon_vbus_dev.edev)
extcon_unregister_interest(&omap->extcon_vbus_dev);
if (omap->extcon_id_dev.edev)
extcon_unregister_interest(&omap->extcon_id_dev);

err2:
dwc3_omap_disable_irqs(omap);

err1:
pm_runtime_put_sync(dev);

err0:
pm_runtime_disable(dev);

return ret;
Expand Down

0 comments on commit 1d662b6

Please sign in to comment.