diff mbox

[RESEND] bus: omap-ocp2scp: Fix error handling in omap_ocp2scp_probe

Message ID 20170711101638.2233-1-kishon@ti.com
State New
Headers show

Commit Message

Kishon Vijay Abraham I July 11, 2017, 10:16 a.m. UTC
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>

---
 drivers/bus/omap-ocp2scp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Tony Lindgren July 12, 2017, 9:26 a.m. UTC | #1
* Kishon Vijay Abraham I <kishon@ti.com> [170711 03:17]:
> 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.


Applying into omap-for-v4.13/fixes thanks.

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kishon Vijay Abraham I July 12, 2017, 10:57 a.m. UTC | #2
On Wednesday 12 July 2017 02:56 PM, Tony Lindgren wrote:
> * Kishon Vijay Abraham I <kishon@ti.com> [170711 03:17]:

>> 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.

> 

> Applying into omap-for-v4.13/fixes thanks.


Thanks!

-Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);