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: 880221 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="JtdbZQjJ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zsrrV1G6cz9sW5 for ; Fri, 2 Mar 2018 12:12:42 +1100 (AEDT) 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 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; }