Commit 45d49cb7 authored by Felipe Balbi's avatar Felipe Balbi Committed by Felipe Balbi

usb: dwc3: omap: fix up error path on probe()

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: default avatarFelipe Balbi <balbi@kernel.org>
[nsekhar@ti.com: patch description updates]
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 138b8638
...@@ -496,7 +496,7 @@ static int dwc3_omap_probe(struct platform_device *pdev) ...@@ -496,7 +496,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(dev); ret = pm_runtime_get_sync(dev);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "get_sync failed with err %d\n", ret); dev_err(dev, "get_sync failed with err %d\n", ret);
goto err0; goto err1;
} }
dwc3_omap_map_offset(omap); dwc3_omap_map_offset(omap);
...@@ -516,28 +516,24 @@ static int dwc3_omap_probe(struct platform_device *pdev) ...@@ -516,28 +516,24 @@ static int dwc3_omap_probe(struct platform_device *pdev)
ret = dwc3_omap_extcon_register(omap); ret = dwc3_omap_extcon_register(omap);
if (ret < 0) if (ret < 0)
goto err2; goto err1;
ret = of_platform_populate(node, NULL, NULL, dev); ret = of_platform_populate(node, NULL, NULL, dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to create dwc3 core\n"); dev_err(&pdev->dev, "failed to create dwc3 core\n");
goto err3; goto err2;
} }
dwc3_omap_enable_irqs(omap); dwc3_omap_enable_irqs(omap);
return 0; return 0;
err3: err2:
extcon_unregister_notifier(omap->edev, EXTCON_USB, &omap->vbus_nb); extcon_unregister_notifier(omap->edev, EXTCON_USB, &omap->vbus_nb);
extcon_unregister_notifier(omap->edev, EXTCON_USB_HOST, &omap->id_nb); extcon_unregister_notifier(omap->edev, EXTCON_USB_HOST, &omap->id_nb);
err2:
dwc3_omap_disable_irqs(omap);
err1: err1:
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
err0:
pm_runtime_disable(dev); pm_runtime_disable(dev);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment