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>
This commit is contained in:
Kishon Vijay Abraham I 2017-07-11 15:46:38 +05:30 коммит произвёл Tony Lindgren
Родитель ff570a01b1
Коммит 672647afab
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -70,8 +70,10 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
if (!of_device_is_compatible(np, "ti,am437x-ocp2scp")) { if (!of_device_is_compatible(np, "ti,am437x-ocp2scp")) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
regs = devm_ioremap_resource(&pdev->dev, res); regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(regs)) if (IS_ERR(regs)) {
goto err0; ret = PTR_ERR(regs);
goto err1;
}
pm_runtime_get_sync(&pdev->dev); pm_runtime_get_sync(&pdev->dev);
reg = readl_relaxed(regs + OCP2SCP_TIMING); reg = readl_relaxed(regs + OCP2SCP_TIMING);
@ -83,6 +85,9 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
return 0; return 0;
err1:
pm_runtime_disable(&pdev->dev);
err0: err0:
device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices); device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);