]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
clk: spear: gpt-synth: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Mon, 11 Aug 2025 15:19:35 +0000 (11:19 -0400)
committerBrian Masney <bmasney@redhat.com>
Mon, 8 Sep 2025 13:41:31 +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/spear/clk-gpt-synth.c

index 4ef747c2abbb0374bec6d6541fa6b8b8904e6c08..cf9659dc9073cba903a0e2a9cef9629ae7f97022 100644 (file)
@@ -39,14 +39,16 @@ static unsigned long gpt_calc_rate(struct clk_hw *hw, unsigned long prate,
        return prate;
 }
 
-static long clk_gpt_round_rate(struct clk_hw *hw, unsigned long drate,
-               unsigned long *prate)
+static int clk_gpt_determine_rate(struct clk_hw *hw,
+                                 struct clk_rate_request *req)
 {
        struct clk_gpt *gpt = to_clk_gpt(hw);
        int unused;
 
-       return clk_round_rate_index(hw, drate, *prate, gpt_calc_rate,
-                       gpt->rtbl_cnt, &unused);
+       req->rate = clk_round_rate_index(hw, req->rate, req->best_parent_rate,
+                                        gpt_calc_rate, gpt->rtbl_cnt, &unused);
+
+       return 0;
 }
 
 static unsigned long clk_gpt_recalc_rate(struct clk_hw *hw,
@@ -104,7 +106,7 @@ static int clk_gpt_set_rate(struct clk_hw *hw, unsigned long drate,
 
 static const struct clk_ops clk_gpt_ops = {
        .recalc_rate = clk_gpt_recalc_rate,
-       .round_rate = clk_gpt_round_rate,
+       .determine_rate = clk_gpt_determine_rate,
        .set_rate = clk_gpt_set_rate,
 };