From patchwork Tue May 17 13:00:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Wu X-Patchwork-Id: 573948 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53C33C433EF for ; Tue, 17 May 2022 13:05:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243018AbiEQNFS (ORCPT ); Tue, 17 May 2022 09:05:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233397AbiEQNFJ (ORCPT ); Tue, 17 May 2022 09:05:09 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B255B49A; Tue, 17 May 2022 06:05:08 -0700 (PDT) Received: from kwepemi500023.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L2bt26xRrzhZ9v; Tue, 17 May 2022 21:04:10 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemi500023.china.huawei.com (7.221.188.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 17 May 2022 21:04:44 +0800 From: Peng Wu To: , , , CC: , , , , Subject: [PATCH] phy: qcom: fix missing clk_disable_unprepare() on err in qcom_pcie2_phy_power_on Date: Tue, 17 May 2022 13:00:00 +0000 Message-ID: <20220517130000.28943-1-wupeng58@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.208] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500023.china.huawei.com (7.221.188.76) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Fix the missing clk_disable_unprepare() before return from qcom_pcie2_phy_power_on() in the error handling case. Signed-off-by: Peng Wu --- drivers/phy/qualcomm/phy-qcom-pcie2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/phy/qualcomm/phy-qcom-pcie2.c b/drivers/phy/qualcomm/phy-qcom-pcie2.c index 5407e59bb185..1cc8145e0811 100644 --- a/drivers/phy/qualcomm/phy-qcom-pcie2.c +++ b/drivers/phy/qualcomm/phy-qcom-pcie2.c @@ -162,8 +162,10 @@ static int qcom_pcie2_phy_power_on(struct phy *phy) ret = readl_poll_timeout(qphy->base + PCIE20_PARF_PHY_STTS, val, !(val & BIT(0)), 1000, 10); - if (ret) + if (ret) { + clk_disable_unprepare(qphy->pipe_clk); dev_err(qphy->dev, "phy initialization failed\n"); + } out: return ret;