]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk: qcom: gcc-ipq4019: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Thu, 3 Jul 2025 23:22:26 +0000 (19:22 -0400)
committerBjorn Andersson <andersson@kernel.org>
Thu, 17 Jul 2025 04:12:56 +0000 (23:12 -0500)
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250703-clk-cocci-drop-round-rate-v1-2-3a8da898367e@redhat.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/clk/qcom/gcc-ipq4019.c

index d38628b5226898b6a556a1fe16806cb79c4735da..5ac44cfb53ce023c0668afdcb67de636f3319197 100644 (file)
@@ -125,21 +125,23 @@ static const struct clk_fepll_vco gcc_fepll_vco = {
  * It looks up the frequency table and returns the next higher frequency
  * supported in hardware.
  */
-static long clk_cpu_div_round_rate(struct clk_hw *hw, unsigned long rate,
-                                  unsigned long *p_rate)
+static int clk_cpu_div_determine_rate(struct clk_hw *hw,
+                                     struct clk_rate_request *req)
 {
        struct clk_fepll *pll = to_clk_fepll(hw);
        struct clk_hw *p_hw;
        const struct freq_tbl *f;
 
-       f = qcom_find_freq(pll->freq_tbl, rate);
+       f = qcom_find_freq(pll->freq_tbl, req->rate);
        if (!f)
                return -EINVAL;
 
        p_hw = clk_hw_get_parent_by_index(hw, f->src);
-       *p_rate = clk_hw_get_rate(p_hw);
+       req->best_parent_rate = clk_hw_get_rate(p_hw);
+
+       req->rate = f->freq;
 
-       return f->freq;
+       return 0;
 };
 
 /*
@@ -205,7 +207,7 @@ clk_cpu_div_recalc_rate(struct clk_hw *hw,
 };
 
 static const struct clk_ops clk_regmap_cpu_div_ops = {
-       .round_rate = clk_cpu_div_round_rate,
+       .determine_rate = clk_cpu_div_determine_rate,
        .set_rate = clk_cpu_div_set_rate,
        .recalc_rate = clk_cpu_div_recalc_rate,
 };