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

index e507aa958da91683ec83837df28fc48be4b7bafa..6f2955d408b651d5c0b943f7c14f83a2974df3e7 100644 (file)
@@ -112,14 +112,16 @@ static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate,
        return bestmult;
 }
 
-static long clk_multiplier_round_rate(struct clk_hw *hw, unsigned long rate,
-                                 unsigned long *parent_rate)
+static int clk_multiplier_determine_rate(struct clk_hw *hw,
+                                        struct clk_rate_request *req)
 {
        struct clk_multiplier *mult = to_clk_multiplier(hw);
-       unsigned long factor = __bestmult(hw, rate, parent_rate,
+       unsigned long factor = __bestmult(hw, req->rate, &req->best_parent_rate,
                                          mult->width, mult->flags);
 
-       return *parent_rate * factor;
+       req->rate = req->best_parent_rate * factor;
+
+       return 0;
 }
 
 static int clk_multiplier_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -150,7 +152,7 @@ static int clk_multiplier_set_rate(struct clk_hw *hw, unsigned long rate,
 
 const struct clk_ops clk_multiplier_ops = {
        .recalc_rate    = clk_multiplier_recalc_rate,
-       .round_rate     = clk_multiplier_round_rate,
+       .determine_rate = clk_multiplier_determine_rate,
        .set_rate       = clk_multiplier_set_rate,
 };
 EXPORT_SYMBOL_GPL(clk_multiplier_ops);