]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
clk: ti: divider: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Mon, 11 Aug 2025 12:48:10 +0000 (08:48 -0400)
committerBrian Masney <bmasney@redhat.com>
Mon, 8 Sep 2025 16:50:55 +0000 (12:50 -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.

Tested-by: Anddreas Kemnade <andreas@kemnade.info> # OMAP3 GTA04, OMAP4 Panda
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
drivers/clk/ti/divider.c

index ade99ab6cfa9b18e5bcfb616273b5c06637035c1..6f58a0f2e74aec14fd3711d722e66b6ecbaef104 100644 (file)
@@ -223,13 +223,15 @@ static int ti_clk_divider_bestdiv(struct clk_hw *hw, unsigned long rate,
        return bestdiv;
 }
 
-static long ti_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-                                     unsigned long *prate)
+static int ti_clk_divider_determine_rate(struct clk_hw *hw,
+                                        struct clk_rate_request *req)
 {
        int div;
-       div = ti_clk_divider_bestdiv(hw, rate, prate);
+       div = ti_clk_divider_bestdiv(hw, req->rate, &req->best_parent_rate);
 
-       return DIV_ROUND_UP(*prate, div);
+       req->rate = DIV_ROUND_UP(req->best_parent_rate, div);
+
+       return 0;
 }
 
 static int ti_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -299,7 +301,7 @@ static void clk_divider_restore_context(struct clk_hw *hw)
 
 const struct clk_ops ti_clk_divider_ops = {
        .recalc_rate = ti_clk_divider_recalc_rate,
-       .round_rate = ti_clk_divider_round_rate,
+       .determine_rate = ti_clk_divider_determine_rate,
        .set_rate = ti_clk_divider_set_rate,
        .save_context = clk_divider_save_context,
        .restore_context = clk_divider_restore_context,