From: Johan Hovold Date: Tue, 22 Oct 2024 08:05:21 +0000 (+0200) Subject: clk: qcom: clk-alpha-pll: fix lucid 5lpe pll enabled check X-Git-Tag: v6.13-rc1~110^2^4^2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05b2363b1359195f3c86c98abc133907f8769a69;p=thirdparty%2Fkernel%2Flinux.git clk: qcom: clk-alpha-pll: fix lucid 5lpe pll enabled check The lucid 5lpe PLL enable check only checks for an impossible negative return value and does not actually return as intended in case the PLL is already enabled (e.g. has been left enabled by boot firmware). Fixes: f4c7e27aa4b6 ("clk: qcom: clk-alpha-pll: Add support for Lucid 5LPE PLL") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20241022080521.359-3-johan+linaro@kernel.org Signed-off-by: Bjorn Andersson --- diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index 99d6962d25bbb..bd1dbef04d9de 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -1903,9 +1903,8 @@ static int alpha_pll_lucid_5lpe_enable(struct clk_hw *hw) } /* Check if PLL is already enabled, return if enabled */ - ret = trion_pll_is_enabled(pll, pll->clkr.regmap); - if (ret < 0) - return ret; + if (trion_pll_is_enabled(pll, pll->clkr.regmap)) + return 0; ret = regmap_update_bits(pll->clkr.regmap, PLL_MODE(pll), PLL_RESET_N, PLL_RESET_N); if (ret)