From patchwork Fri Mar 2 01:12:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 10252993 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F2D96602B5 for ; Fri, 2 Mar 2018 01:12:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E260D203B9 for ; Fri, 2 Mar 2018 01:12:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7133219AC; Fri, 2 Mar 2018 01:12:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E9DB203B9 for ; Fri, 2 Mar 2018 01:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163372AbeCBBMj (ORCPT ); Thu, 1 Mar 2018 20:12:39 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:33276 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163289AbeCBBMh (ORCPT ); Thu, 1 Mar 2018 20:12:37 -0500 Received: by mail-pl0-f66.google.com with SMTP id c11-v6so4720888plo.0 for ; Thu, 01 Mar 2018 17:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P08v0/FmDvjICZ5/0nzvHv9y9km/6gmCuEJXAxI+FpY=; b=JtdbZQjJL8kiucLPlKq9kbkD/ogdTbaIqBHGMwkMa9BCIKSsM6+gJvqTWiwppNmJ2N P/t++ShBCuQcQGYsUjSf/ao0SUqA477s4m1zVZNyFy9etYqVCxYHfz+9ueapB1Ym7as0 FZAa8VkXDkQX7Wuja8jHsX0cTqOad57huurMo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P08v0/FmDvjICZ5/0nzvHv9y9km/6gmCuEJXAxI+FpY=; b=KdFC7e/+FafYpV6zk67+243NorLRTExY0SY0EHZw5mhmbj9aoAlD83g+Dg4z1/+Mq+ wACFYVF7f/H3kshx+c4RnszwFiBSmhBS1cZw9dUOFATUfC4I+1FtPZa5ruutJokHy42J 8QpJV55tN3syAuFTjGr1MngsLWiMYLcpH7I2zIeSOmhd3jyXgl6ay9L23Fpv+cdnXZ2p ehkzXz5cm2PlbCulJv8qn4YgbDq2pWqbMr0fQcEV+IVyK65oZ8VHapDEFYcMAI0LdwvT jM75HruW92E10TrO/QFXJkSRPo1YNSPXOisr32hdM5o6C4i+JUl8rskg64Twb+R0cvkf CsXw== X-Gm-Message-State: APf1xPD+uhCbF9O/06S1uaiHmiCq1EN56CfKOEZzpOSFYuxhmmDzs7Dh 6yZbQZP+atQMX3BpiGrj5ENE5g== X-Google-Smtp-Source: AG47ELvY/tS+d/OdAhAvEUUwrHyg3aiBE6Lo4pekfPIBAU143ImJXPV8sQ9gz78LOniGvbg2TKJGeA== X-Received: by 2002:a17:902:146:: with SMTP id 64-v6mr3398676plb.30.1519953157486; Thu, 01 Mar 2018 17:12:37 -0800 (PST) Received: from localhost.localdomain ([45.56.152.106]) by smtp.gmail.com with ESMTPSA id z22sm2186864pfd.158.2018.03.01.17.12.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 17:12:36 -0800 (PST) From: Shawn Guo To: Lorenzo Pieralisi Cc: Bjorn Helgaas , Rob Herring , Fabio Estevam , Jianguo Sun , Jiancheng Xue , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, Shawn Guo Subject: [PATCH v3 1/2] PCI: histb: Fix error path of histb_pcie_host_enable() Date: Fri, 2 Mar 2018 09:12:00 +0800 Message-Id: <1519953121-28218-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519953121-28218-1-git-send-email-shawn.guo@linaro.org> References: <1519953121-28218-1-git-send-email-shawn.guo@linaro.org> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If clk_prepare_enable() call fails on a particular clock, we should not call clk_disable_unprepare() on this clock, but on the clocks that succeed from clk_prepare_enable() previously. Signed-off-by: Shawn Guo --- drivers/pci/dwc/pcie-histb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/pci/dwc/pcie-histb.c b/drivers/pci/dwc/pcie-histb.c index 70b5c0b108bf..17ed604f5741 100644 --- a/drivers/pci/dwc/pcie-histb.c +++ b/drivers/pci/dwc/pcie-histb.c @@ -276,13 +276,12 @@ static int histb_pcie_host_enable(struct pcie_port *pp) return 0; err_aux_clk: - clk_disable_unprepare(hipcie->aux_clk); -err_pipe_clk: clk_disable_unprepare(hipcie->pipe_clk); -err_sys_clk: +err_pipe_clk: clk_disable_unprepare(hipcie->sys_clk); -err_bus_clk: +err_sys_clk: clk_disable_unprepare(hipcie->bus_clk); +err_bus_clk: return ret; }