Re: [PATCH] clk: qcom: clk-alpha-pll: Do not use random stack value for recalc rate

From: Krzysztof Kozlowski
Date: Tue Dec 03 2024 - 02:23:29 EST


On 03/12/2024 06:08, Stephen Boyd wrote:
>> diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
>> index 5e9217ea3760..0cd937ab47d0 100644
>> --- a/drivers/clk/qcom/clk-alpha-pll.c
>> +++ b/drivers/clk/qcom/clk-alpha-pll.c
>> @@ -682,9 +682,12 @@ clk_alpha_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
>> struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
>> u32 alpha_width = pll_alpha_width(pll);
>>
>> - regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l);
>> + if (regmap_read(pll->clkr.regmap, PLL_L_VAL(pll), &l))
>> + return 0;
>> +
>> + if (regmap_read(pll->clkr.regmap, PLL_USER_CTL(pll), &ctl))
>> + return 0;
>>
>> - regmap_read(pll->clkr.regmap, PLL_USER_CTL(pll), &ctl);
>> if (ctl & PLL_ALPHA_EN) {
>> regmap_read(pll->clkr.regmap, PLL_ALPHA_VAL(pll), &low);
>
> What about 'low'?

Indeed, this and one more below regmap_read also need it.

Best regards,
Krzysztof