From patchwork Tue Jan 23 15:45:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 10180605 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 46AEE601D5 for ; Tue, 23 Jan 2018 15:46:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 285AF283F9 for ; Tue, 23 Jan 2018 15:46:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C641287B4; Tue, 23 Jan 2018 15:46:10 +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 AF461283F9 for ; Tue, 23 Jan 2018 15:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbeAWPqG (ORCPT ); Tue, 23 Jan 2018 10:46:06 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:43256 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751567AbeAWPqB (ORCPT ); Tue, 23 Jan 2018 10:46:01 -0500 Received: by mail-pf0-f195.google.com with SMTP id y26so605726pfi.10 for ; Tue, 23 Jan 2018 07:46:01 -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=fwtSki4memuzbfsYnQr4sd2WmbLzKVJPXbbu1bPrUOc=; b=CjFS/CRMgsBiSCxSqQ+x0AeRk7qtld76vuOHuxkxCaRtsnAmy2ZZKfnBCg9T6Qanwc C9M4YNbJwjO1EuFvvYkZu2Pl0/u9fufbHDtfU2KlJWQe/XEsa8yeco3qDVXR4nkjkdID QcKRxA70VJupCkxCbHSBOPZyDni81Sxs2+SgM= 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=fwtSki4memuzbfsYnQr4sd2WmbLzKVJPXbbu1bPrUOc=; b=kwCROLnGuxlMAc7R3bFtkeK0Xxr1hwiD+Y+S3MsJIwKjSqcDIBrht2oQyU4yRn7d57 CeMJutclHDzQSwa7YDizQ3vKLA+UvZzCRBmtCC1Mb4F7QAqmNCCIY5OnrTPAriJpKkNh XYKbH+cQpdLvdYrgbP+aZxPs9LkuWMLmnXSfUztH05SRNpaK5I3+egb8RR07K/IIXABK +OsDk/8XlcDGa/UJVJ9VLlg0/fgIbRTJCApOavsU9oCefLQE67rsYvdj1vnXIXJDSnRy WmvYf9uYRsRkCaKieMl29pczuDsmEggOo/coPQ6DaU5i9SVPZKRIMDcvnt3R88db+JYY sHpw== X-Gm-Message-State: AKwxytfNPYA1cRxgjydXI/KWMn0HNHS7uFKglFmimM1K8zLwQRopYpA/ fNIeFsQQA/SDZnlZqh82mii3gg== X-Google-Smtp-Source: AH8x226yilU9wj4w1RGrg+NOuP17zB1P20f34Cb9F7e6stHRsMX7S9Jy4FdGDS4qCJKcIcFz0ZeWUA== X-Received: by 2002:a17:902:6087:: with SMTP id s7-v6mr5775488plj.6.1516722360567; Tue, 23 Jan 2018 07:46:00 -0800 (PST) Received: from localhost.localdomain ([45.56.152.94]) by smtp.gmail.com with ESMTPSA id v15sm7229037pfa.68.2018.01.23.07.45.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jan 2018 07:45:59 -0800 (PST) From: Shawn Guo To: Bjorn Helgaas Cc: Rob Herring , Fabio Estevam , Jianguo Sun , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, project-aspen-dev@linaro.org, Shawn Guo Subject: [PATCH v2 1/2] PCI: histb: fix error path of histb_pcie_host_enable() Date: Tue, 23 Jan 2018 23:45:36 +0800 Message-Id: <1516722337-1533-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516722337-1533-1-git-send-email-shawn.guo@linaro.org> References: <1516722337-1533-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 33b01b734d7d..6395394be5b4 100644 --- a/drivers/pci/dwc/pcie-histb.c +++ b/drivers/pci/dwc/pcie-histb.c @@ -279,13 +279,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; }