From patchwork Tue Jul 11 10:16:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 107342 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4658635qge; Tue, 11 Jul 2017 03:17:12 -0700 (PDT) X-Received: by 10.98.202.12 with SMTP id n12mr50059415pfg.187.1499768232742; Tue, 11 Jul 2017 03:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499768232; cv=none; d=google.com; s=arc-20160816; b=IVlkt3vTOCOqJmVqr2R2dWE57G/YOr0nPT8pbDVP4Fai4LC2TCgkYc7TwkJug6xU7e dyu3mV09gP65p0a2LC5E+3r6lS4W1KJ26auo4xFpQgLHHqqkQTi3ONunZAtpbkNctGlZ rDXeox8pQWhqO7jxTRaY+/Aik8cjYRNyl5ERvxyo+F0j9Ocjzhyf4PFfMT58pL5/im2f gcTJ23gLHvI9KyDT9bZvaI0b1DOFMBwzAzi/8lueuu9UKfY9sy5I+5iBCiR5JqgCfxg2 rT1hp3hhM+Zg02rg1J+6mwERtz7Fu29rh0zMhcuPxXKXijA8R2d5fN+nvmeNP2GRaKux W8Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=yGiXrOS8AId5AxSSZwM/gAiEgShHQhdk+mmp9vBqB20=; b=EarbKJLCFeErN0XEHlpfBMydAbFc4bdBvzecqsBK3H6vHtq/lJ0tckScIwfqQbyRto XRbZwMCfdaZY9Ay8PNF/NKtrwo1TdKqMK8aF0KhE7C9d+UmqGyv0dCCLaiqCYwLyhKvQ 3rPi/XLobT2P/kD5iHlST1nBFlsM0i3vd/FdPJpzL1HjplAu8pRdO8XOHayHO/inMQir +GOPcmxsbND/6nRlKPgL+TSA2HWouMXDSX2q0z5ektoU+hjRsmwNjfkImaDecYaTIIMs Ccglq0IwN4oRyC6KY80CcrqOoqKCTd49evab0RIpyLY+h3tMY/mGGJs27tHaLe8YrnLO DQVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.b=LuB6H//j; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w26si5588017pfi.302.2017.07.11.03.17.12; Tue, 11 Jul 2017 03:17:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.b=LuB6H//j; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932341AbdGKKRL (ORCPT + 3 others); Tue, 11 Jul 2017 06:17:11 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:33329 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932322AbdGKKRK (ORCPT ); Tue, 11 Jul 2017 06:17:10 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v6BAGfGr006696; Tue, 11 Jul 2017 05:16:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1499768201; bh=owJyL/k1czh7I+LuU9BJkwuGh2zPYqMTAZe4aMkY7PM=; h=From:To:CC:Subject:Date; b=LuB6H//jXOIETcjJPSrwy2Sx6n2zl+jeo2XxV3pQBftZI66d2I9dDjVuAXguxaDEG 9WNeyXR3cGd4g/fyAELpy1qoZEv8kOK83kNutD4HNnSPH47vMSeRa6S0H6lnZc/8ir v8+nQToGJSIyv3jHAY0Gq5uYLyq+FdfZ1vMN/khU= Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v6BAGflN014146; Tue, 11 Jul 2017 05:16:41 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Tue, 11 Jul 2017 05:16:40 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v6BAGcUL015213; Tue, 11 Jul 2017 05:16:39 -0500 From: Kishon Vijay Abraham I To: Tony Lindgren , CC: "arnd @ arndb . de" , , , , Subject: [RESEND PATCH] bus: omap-ocp2scp: Fix error handling in omap_ocp2scp_probe Date: Tue, 11 Jul 2017 15:46:38 +0530 Message-ID: <20170711101638.2233-1-kishon@ti.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 Signed-off-by: Sekhar Nori --- 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 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);