summaryrefslogtreecommitdiff
path: root/drivers/bus/omap-ocp2scp.c
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2017-07-11 13:16:38 +0300
committerTony Lindgren <tony@atomide.com>2017-07-12 12:25:41 +0300
commit672647afabf5bafd3d855724ee5829e2a9cbd65b (patch)
tree02560fd2ee8afe589959e83d144cc07a10c8132e /drivers/bus/omap-ocp2scp.c
parentff570a01b1bd15cf8a87c9ea774fc9c52ea07f15 (diff)
downloadlinux-672647afabf5bafd3d855724ee5829e2a9cbd65b.tar.xz
bus: omap-ocp2scp: Fix error handling in omap_ocp2scp_probe
The error handling code in omap_ocp2scp_probe fails to invoke pm_runtime_disable and fails to initialize return value in certain cases. Fix it here. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/bus/omap-ocp2scp.c')
-rw-r--r--drivers/bus/omap-ocp2scp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c
index bf500e0e7362..77791f3dcfc6 100644
--- a/drivers/bus/omap-ocp2scp.c
+++ b/drivers/bus/omap-ocp2scp.c
@@ -70,8 +70,10 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
if (!of_device_is_compatible(np, "ti,am437x-ocp2scp")) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
regs = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(regs))
- goto err0;
+ if (IS_ERR(regs)) {
+ ret = PTR_ERR(regs);
+ goto err1;
+ }
pm_runtime_get_sync(&pdev->dev);
reg = readl_relaxed(regs + OCP2SCP_TIMING);
@@ -83,6 +85,9 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
return 0;
+err1:
+ pm_runtime_disable(&pdev->dev);
+
err0:
device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);