From patchwork Fri Jun 28 20:54:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Quinlan X-Patchwork-Id: 13716589 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE738C30658 for ; Fri, 28 Jun 2024 20:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X4Ny5+8/HKp++rn3a53TBC7WhwfGjQxrEcZn2u5Dkyo=; b=eYOaebd9MirtG9de4/4SBREbqD +Z8p2cQRGMzWbUcIM/NWTrBsPaqN2cB1qVAjMoZiZrbsopMufrn+TmTa5TsriKAulTmSw14MD0+pZ 53R/FpN6ADcUUCtn6HkJGERkPrDIsoCbN4SkzQ9NCBbmjgkPppGP5UFvenYeCPuK+pyA0qJFswlc6 8oFrfHbIwh5nKdpVXRzYsIdPDTT7JUiHGs/uvnlAYsUfYXtB3sl2OZ4jFjMv3/bOkrT7kvFUgS7jU 6F8+HpkTKedMX3umDSs8I6wtmul3cvqi/l+AtGkUVWEPbl79tyYl3aBRffDPZJf2N4xj5aX3WFAv8 AK51VXYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNIcm-0000000EvHf-3lbX; Fri, 28 Jun 2024 20:55:16 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNIcG-0000000Euup-3v3I for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2024 20:54:47 +0000 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-6e3741519d7so706505a12.2 for ; Fri, 28 Jun 2024 13:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1719608083; x=1720212883; darn=lists.infradead.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=X4Ny5+8/HKp++rn3a53TBC7WhwfGjQxrEcZn2u5Dkyo=; b=X5uughwv3xNLRkxSHURtbCwyQMmF/5jJsHU9g1VuoFocgndb2Ohqs/8vawciuwWrxn Wfro47HFme4ou6/Hzvwkt+3cTSBZWApDhTL1vTu4URQGP52Wfz4W9LGb0IKYhbIFcQ3r X3oWlOxTjldOL8zTbOdaT69Lie8lG9so82XHg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608083; x=1720212883; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X4Ny5+8/HKp++rn3a53TBC7WhwfGjQxrEcZn2u5Dkyo=; b=QcQp5JtLbhOaxXOC0KReYyP5yV81j5927GlnQa+dtvnifP0hcnxnZO8J5NcjOGAhqz Pf7q4Kp0ua5ocA2V5q44mBSUaS2qIjg7gOnbT5GKPAfquvCQYaBBM+veviN1aZFjH9L3 dJDaPCrYzIoFMYt6B53UKeVzEgj/JEuNgQwzQVu3dNTBeyifr1wkiFu4pNO9BdxXnbCD igi7E1lmFFcGFd5xWziZQWhJqImIONpcoO51GmBaJCt1t8zWeP8874ZTjuG47Rpmd3+M jerczkKaHFM3ofGVz2N4JhYPVuYmJCUtC46OT7aG/N3KHDvb5J3zgIw+X/349IU+CQp2 4brw== X-Forwarded-Encrypted: i=1; AJvYcCWBNgJ6E0qDOwIgVDHwebt3LW27L0wjy60d6zVeArXRT3jb5mfTJRJFM+fyQoVi1BtBkDd6bIoYxuGCDBojliZ0mMfJe4eGmsdqjfqEp1VgPwHmOm4= X-Gm-Message-State: AOJu0Yzg6SSNlrX4lRSzxBoenew3Le9lmDHVmobjqDX6cqpjC9onz3LI jjU+H0E+btWrLD6lE2VA7qqG/+8GrTgSuOj7OHU2ofCe0nFSlZeW+djd56Cigw== X-Google-Smtp-Source: AGHT+IEjEyzsDfVcrmM1ByRve/0wh2Kf3Gn6sPZupq9P8Kzpcsawn6x/9OP/l3k9kT5VC/EiWbN/+w== X-Received: by 2002:a05:6a20:734f:b0:1bd:2b58:c62c with SMTP id adf61e73a8af0-1bd2b59f156mr12722475637.53.1719608082554; Fri, 28 Jun 2024 13:54:42 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac15393d1sm19695135ad.157.2024.06.28.13.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 13:54:41 -0700 (PDT) From: Jim Quinlan To: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , Stanimir Varbanov , bcm-kernel-feedback-list@broadcom.com, jim2101024@gmail.com, james.quinlan@broadcom.com Cc: Florian Fainelli , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 2/8] PCI: brcmstb: Use "clk_out" error path label Date: Fri, 28 Jun 2024 16:54:21 -0400 Message-Id: <20240628205430.24775-3-james.quinlan@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240628205430.24775-1-james.quinlan@broadcom.com> References: <20240628205430.24775-1-james.quinlan@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240628_135445_140308_64992F32 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of invoking "clk_disable_unprepare(pcie->clk)" in a number of error paths. Signed-off-by: Jim Quinlan --- drivers/pci/controller/pcie-brcmstb.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index c08683febdd4..c2eb29b886f7 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -1620,24 +1620,25 @@ static int brcm_pcie_probe(struct platform_device *pdev) } pcie->rescal = devm_reset_control_get_optional_shared(&pdev->dev, "rescal"); if (IS_ERR(pcie->rescal)) { - clk_disable_unprepare(pcie->clk); - return PTR_ERR(pcie->rescal); + ret = PTR_ERR(pcie->rescal); + goto clk_out; } pcie->perst_reset = devm_reset_control_get_optional_exclusive(&pdev->dev, "perst"); if (IS_ERR(pcie->perst_reset)) { - clk_disable_unprepare(pcie->clk); - return PTR_ERR(pcie->perst_reset); + ret = PTR_ERR(pcie->perst_reset); + goto clk_out; } ret = reset_control_reset(pcie->rescal); - if (ret) + if (ret) { dev_err(&pdev->dev, "failed to deassert 'rescal'\n"); + goto clk_out; + } ret = brcm_phy_start(pcie); if (ret) { reset_control_rearm(pcie->rescal); - clk_disable_unprepare(pcie->clk); - return ret; + goto clk_out; } ret = brcm_pcie_setup(pcie); @@ -1676,6 +1677,9 @@ static int brcm_pcie_probe(struct platform_device *pdev) return 0; +clk_out: + clk_disable_unprepare(pcie->clk); + return ret; fail: __brcm_pcie_remove(pcie); return ret;