From patchwork Tue Jun 25 23:33:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 167761 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp161754ilk; Tue, 25 Jun 2019 16:33:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZn6e5GI8cYB73/bJPkvHAFYEuBdV5rPoqjVjW27RoXIl3NUgCfRiB4FyCiK7lthAJEB8D X-Received: by 2002:a17:90a:7d04:: with SMTP id g4mr518260pjl.41.1561505608783; Tue, 25 Jun 2019 16:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561505608; cv=none; d=google.com; s=arc-20160816; b=STVHxG3/jVY2BKd3AGL9+ekdiVVxmFoCz6OqephXfRtg24C18JzBCMPX6JFPN3eham S7/pjK4M8NbyHvWwxob9KtJxIudGRhhiF2Y5PeDmMrCJ7K4jPcwdf9Rl92D77Hkxi7XI P64YMuJ1FyiC193ncmayExlh/46u95RBWBRvi0R7q5URKJOcmeDw2mUbwS3yujEMLJ8/ adVIryI745WXY73gFSopS+dvEjwnrhlH/g2tg52B4pq/NrEcaPw6zSYS4NLDB4DN0CFJ UJKNGXfdhvlbUa4GFo19B0hJZVNNnpOpV5IUx+51mO73rEmiSF5BrisrI6k5KssRTxKJ hFEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Hf5WBQjuZeCiIOSYjh2XZnVhPWosSAdGoW3RjyhnBbk=; b=JmRZAUOHIcRY8E7g+FlDeH5igM2R3Bzd2V0LNBoG4jm+fRX+xLXp0Hp1h4tEJR7GQw N4/poqfLXk+dvzWAUF6fxDajWanZrvXpm03UQFFbzKCb/LDlTpzprLSpAT19+BsjfJ22 O1R4uqD7ZTNe87BT4Y0cjri3X3gQOhKoLnvfjT47LvpB3ZF53SoWvwk46mMg/5vVDXCf k6I8FdJK1mu4pTbtdrWpCRSEt4eog9nJXDp9ZuVWtn42PuyIJkeuDh/j5YTDnjHT/DTx qYsJf+GAsFsUe4pxbpmNGcLVflJL2e7jeB7defrp8sz+MIoa2mRU+xfyJPSEZxABeaGU 6Z1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ehDaP4bL; 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=pass (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 u91si200118pjb.37.2019.06.25.16.33.28; Tue, 25 Jun 2019 16:33:28 -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=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ehDaP4bL; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726443AbfFYXd1 (ORCPT + 5 others); Tue, 25 Jun 2019 19:33:27 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:34984 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726407AbfFYXdY (ORCPT ); Tue, 25 Jun 2019 19:33:24 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x5PNXMMg129970; Tue, 25 Jun 2019 18:33:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1561505602; bh=Hf5WBQjuZeCiIOSYjh2XZnVhPWosSAdGoW3RjyhnBbk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ehDaP4bLobbPg5838f2bwcWPaClKhU0ZfDqadWiVkxdaB+LzNsWrvlCJczKJ9U5dC GXssU8PCXam00m8jp3USZtVq03oa9BffdMTtXnoPaCiS0cB0wDHAge6GIHCtmH0Fjh gwd1yO8C0Aqo0xKFXYFyXo7hQVkrLtBIm+yaBzqg= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x5PNXMj3010797 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 25 Jun 2019 18:33:22 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 25 Jun 2019 18:33:21 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 25 Jun 2019 18:33:21 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x5PNXLx3125267; Tue, 25 Jun 2019 18:33:21 -0500 Received: from localhost (irmo.dhcp.ti.com [128.247.58.153]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id x5PNXLm12251; Tue, 25 Jun 2019 18:33:21 -0500 (CDT) From: Suman Anna To: Tony Lindgren CC: Tero Kristo , Roger Quadros , , , Suman Anna Subject: [PATCH 5/5] bus: ti-sysc: Simplify cleanup upon failures in sysc_probe() Date: Tue, 25 Jun 2019 18:33:15 -0500 Message-ID: <20190625233315.22301-6-s-anna@ti.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190625233315.22301-1-s-anna@ti.com> References: <20190625233315.22301-1-s-anna@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The clocks are not yet parsed and prepared until after a successful sysc_get_clocks(), so there is no need to unprepare the clocks upon any failure of any of the prior functions in sysc_probe(). The current code path would have been a no-op because of the clock validity checks within sysc_unprepare(), but let's just simplify the cleanup path by returning the error directly. While at this, also fix the cleanup path for a sysc_init_resets() failure which is executed after the clocks are prepared. Signed-off-by: Suman Anna --- drivers/bus/ti-sysc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.21.0 diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index ccdd1f0871f9..a7e704e0840d 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -2384,27 +2384,27 @@ static int sysc_probe(struct platform_device *pdev) error = sysc_init_dts_quirks(ddata); if (error) - goto unprepare; + return error; error = sysc_map_and_check_registers(ddata); if (error) - goto unprepare; + return error; error = sysc_init_sysc_mask(ddata); if (error) - goto unprepare; + return error; error = sysc_init_idlemodes(ddata); if (error) - goto unprepare; + return error; error = sysc_init_syss_mask(ddata); if (error) - goto unprepare; + return error; error = sysc_init_pdata(ddata); if (error) - goto unprepare; + return error; sysc_init_early_quirks(ddata); @@ -2414,7 +2414,7 @@ static int sysc_probe(struct platform_device *pdev) error = sysc_init_resets(ddata); if (error) - return error; + goto unprepare; error = sysc_init_module(ddata); if (error)