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

index 249d6a53cedf5da1c2d877762474592e4b3fda40..5c5f7398effee1447ff86516c2cec1ddc1adc542 100644 (file)
@@ -231,13 +231,15 @@ static long clk_pll_get_best_div_mul(struct clk_pll *pll, unsigned long rate,
        return bestrate;
 }
 
-static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-                                       unsigned long *parent_rate)
+static int clk_pll_determine_rate(struct clk_hw *hw,
+                                 struct clk_rate_request *req)
 {
        struct clk_pll *pll = to_clk_pll(hw);
 
-       return clk_pll_get_best_div_mul(pll, rate, *parent_rate,
-                                       NULL, NULL, NULL);
+       req->rate = clk_pll_get_best_div_mul(pll, req->rate, req->best_parent_rate,
+                                            NULL, NULL, NULL);
+
+       return 0;
 }
 
 static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -302,7 +304,7 @@ static const struct clk_ops pll_ops = {
        .unprepare = clk_pll_unprepare,
        .is_prepared = clk_pll_is_prepared,
        .recalc_rate = clk_pll_recalc_rate,
-       .round_rate = clk_pll_round_rate,
+       .determine_rate = clk_pll_determine_rate,
        .set_rate = clk_pll_set_rate,
        .save_context = clk_pll_save_context,
        .restore_context = clk_pll_restore_context,