]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
clk: stm32: stm32mp1: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Mon, 11 Aug 2025 15:18:51 +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.

Reviewed-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
drivers/clk/stm32/clk-stm32mp1.c

index b8b45ed22f981df580506f3d4ca801ba11d2bab2..2d9ccd96ec98c05eb836d632bfd9903de60ba1bb 100644 (file)
@@ -970,12 +970,15 @@ static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate,
        return mult;
 }
 
-static long timer_ker_round_rate(struct clk_hw *hw, unsigned long rate,
-                                unsigned long *parent_rate)
+static int timer_ker_determine_rate(struct clk_hw *hw,
+                                   struct clk_rate_request *req)
 {
-       unsigned long factor = __bestmult(hw, rate, *parent_rate);
+       unsigned long factor = __bestmult(hw, req->rate,
+                                         req->best_parent_rate);
 
-       return *parent_rate * factor;
+       req->rate = req->best_parent_rate * factor;
+
+       return 0;
 }
 
 static int timer_ker_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -1026,7 +1029,7 @@ static unsigned long timer_ker_recalc_rate(struct clk_hw *hw,
 
 static const struct clk_ops timer_ker_ops = {
        .recalc_rate    = timer_ker_recalc_rate,
-       .round_rate     = timer_ker_round_rate,
+       .determine_rate = timer_ker_determine_rate,
        .set_rate       = timer_ker_set_rate,
 
 };