From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0838C49ED7 for ; Thu, 19 Sep 2019 22:32:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75D28208C0 for ; Thu, 19 Sep 2019 22:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568932356; bh=y+twx5L5mLyZA/HpEM5GdqYd/BMLorMN/INrMAODq3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=nvSHK3Y0Xc9PJIam7BENofzsxanL0GfkPh/DFfT5gsKGmU4W3nWpCWBEKkW63HAIP 3677MAV34rIxLySvkMDpxTSRshw63YExepoloxuhb3DAd/AttCFIDKIcki/Nkp58K4 Z10C2OqJOlfbNFUJfZxRQqAt5mgc33Bn2sZEnaMM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405998AbfISWMy (ORCPT ); Thu, 19 Sep 2019 18:12:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:51894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393681AbfISWMv (ORCPT ); Thu, 19 Sep 2019 18:12:51 -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 75BB921928; Thu, 19 Sep 2019 22:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568931170; bh=y+twx5L5mLyZA/HpEM5GdqYd/BMLorMN/INrMAODq3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ue5IpRDi6+eu2tS11NUGPIDBvRmMomHTmLbPeXCesxjePG6l/A7mhyiIfs3a9Int5 +WjOJ5vWzpJ1q6cPLH8Z+HBLAIvtIK0x0U29nYsW8aHJD4rYVlFlYPPQVjSUuNg0KQ sn+xg4sYM8OCBK3PXSspzx3JOYkdwjX7SQpM2LQA= 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 4.19 28/79] bus: ti-sysc: Simplify cleanup upon failures in sysc_probe() Date: Fri, 20 Sep 2019 00:03:13 +0200 Message-Id: <20190919214810.352045042@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214807.612593061@linuxfoundation.org> References: <20190919214807.612593061@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 4ca006e2137f7..e95b26319cd91 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -1685,7 +1685,7 @@ static int sysc_probe(struct platform_device *pdev) error = sysc_init_dts_quirks(ddata); if (error) - goto unprepare; + return error; error = sysc_get_clocks(ddata); if (error) @@ -1693,27 +1693,27 @@ static int sysc_probe(struct platform_device *pdev) 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; error = sysc_init_resets(ddata); if (error) - return error; + goto unprepare; pm_runtime_enable(ddata->dev); error = sysc_init_module(ddata); -- 2.20.1