From patchwork Thu Sep 19 22:02:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 174102 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1594516ill; Thu, 19 Sep 2019 15:09:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCKRxq9gYJIeOLLsR47Q/TZQ62XRGihuzPk1xK2YThZBz7YvyT2R0J3NCkwJLkt7NACtRV X-Received: by 2002:a17:906:4b07:: with SMTP id y7mr6924701eju.126.1568930953687; Thu, 19 Sep 2019 15:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568930953; cv=none; d=google.com; s=arc-20160816; b=trPj6ntguwQ1eOr/h9l20FH1bPixHwc/U1bvhY9F5dCh04834WeZdgtywDYyhkaujP Wf2LA9WQnEqK3ojavhF3X9VDgEnFrchNAj5eTJWb3M7D2f43RJb60pufSMsgP6f7Xj6Q BfCOuLS+3RTsY5P1iJ96GQFMUjoLT0twW8zSuO98AxhHsWT1qrBFkz9bsPryKbLkE6kW tR/xW9HKVAQCq6ebGjiGc0jmSc+l/McF4mSlbgRi6aJ9tEXI0lF5M8JqYLLQwvrpJApG upeDTzpK+gHcYXIcCDAXwWgrZiDNW0nEMIBVUEJLHz5prr0ZvH7DRTghsHvfca4E1Aub ssmQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jCJfbMdA2aomDK+Hmv0vwcqbZlwIPYEVxqpehD++TaY=; b=e7tIn99GBIH/Ew8WPLkajWlD7F4jzx8Xgt7KwmadBQljf+3hrCPpwxerDwRZLsVHez MCL/53zWgIKzGYzbaElUsYj3aL1jAgzn941ydHxBwT8v+ki6EYnFcwv0nDn2zgsBGIco mIvCRHH+4RTkvvNnQUAMSKBVvKq3vkhKtcclaiEy+o7ucc1kq6+xlpsFvAeWanSXOV4P MjSMdClpfuJ9KV77po36BINpZTN7TG/raXLOwPBeuCXi+RJKR+q7AhqHxsit5qvU/0dt 5fUak5JAgIV/0p0F+mTC4qLrYVUu80PZKBOoX1fjoVBmzeYeuPGX4JrDc1guKhkU6DfG etIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hzhGWZFt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si80665edz.77.2019.09.19.15.09.13; Thu, 19 Sep 2019 15:09:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=hzhGWZFt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393525AbfISWJL (ORCPT + 26 others); Thu, 19 Sep 2019 18:09:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:47256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393510AbfISWJI (ORCPT ); Thu, 19 Sep 2019 18:09:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3287C218AF; Thu, 19 Sep 2019 22:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568930947; bh=P61d7vQAF7kIVJkuTM20VyYtHx9B6Qw/zHAPMhHkpuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzhGWZFtpKByb5jzUwftziyieO8kGU28reDr3hUSiswznAZ4OLDEBGx9ATKR9m8lr pG0E1+8KeQkSRc/0B5MRDLJR5CCusyamYr2TrAj6CKm813CX7QxmkYXrhPwlYzOxJ3 h0zznHx1MK2w3yMocdtD8zNlF3gRJ5/JG866kLxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suman Anna , Tony Lindgren , Sasha Levin Subject: [PATCH 5.2 041/124] bus: ti-sysc: Simplify cleanup upon failures in sysc_probe() Date: Fri, 20 Sep 2019 00:02:09 +0200 Message-Id: <20190919214820.500895647@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214819.198419517@linuxfoundation.org> References: <20190919214819.198419517@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suman Anna [ Upstream commit a304f483b6b00d42bde41c45ca52c670945348e2 ] 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 Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- drivers/bus/ti-sysc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 58b38630171ff..0d122440d1111 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -2079,27 +2079,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); @@ -2109,7 +2109,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)