]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk: sparx5: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Mon, 11 Aug 2025 15:18:44 +0000 (11:18 -0400)
committerBrian Masney <bmasney@redhat.com>
Mon, 8 Sep 2025 13:41:28 +0000 (09:41 -0400)
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>
drivers/clk/clk-sparx5.c

index 0fad0c1a01862be221b4a53b2deb9239c335479a..b2facc9c95d471ee515c439cee83ab43187ff967 100644 (file)
@@ -213,19 +213,21 @@ static unsigned long s5_pll_recalc_rate(struct clk_hw *hw,
        return conf.freq;
 }
 
-static long s5_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-                             unsigned long *parent_rate)
+static int s5_pll_determine_rate(struct clk_hw *hw,
+                                struct clk_rate_request *req)
 {
        struct s5_pll_conf conf;
 
-       return s5_calc_params(rate, *parent_rate, &conf);
+       req->rate = s5_calc_params(req->rate, req->best_parent_rate, &conf);
+
+       return 0;
 }
 
 static const struct clk_ops s5_pll_ops = {
        .enable         = s5_pll_enable,
        .disable        = s5_pll_disable,
        .set_rate       = s5_pll_set_rate,
-       .round_rate     = s5_pll_round_rate,
+       .determine_rate = s5_pll_determine_rate,
        .recalc_rate    = s5_pll_recalc_rate,
 };