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

index bb8c23d2b895ff1975165443b4bd2541e9d6e272..e39f53d5bf4578c628d34b05233c8e8da317c4d4 100644 (file)
@@ -39,12 +39,16 @@ static unsigned long ma35d1_clkdiv_recalc_rate(struct clk_hw *hw, unsigned long
                                   CLK_DIVIDER_ROUND_CLOSEST, dclk->width);
 }
 
-static long ma35d1_clkdiv_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate)
+static int ma35d1_clkdiv_determine_rate(struct clk_hw *hw,
+                                       struct clk_rate_request *req)
 {
        struct ma35d1_adc_clk_div *dclk = to_ma35d1_adc_clk_div(hw);
 
-       return divider_round_rate(hw, rate, prate, dclk->table,
-                                 dclk->width, CLK_DIVIDER_ROUND_CLOSEST);
+       req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+                                      dclk->table, dclk->width,
+                                      CLK_DIVIDER_ROUND_CLOSEST);
+
+       return 0;
 }
 
 static int ma35d1_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate)
@@ -71,7 +75,7 @@ static int ma35d1_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate, unsigne
 
 static const struct clk_ops ma35d1_adc_clkdiv_ops = {
        .recalc_rate = ma35d1_clkdiv_recalc_rate,
-       .round_rate = ma35d1_clkdiv_round_rate,
+       .determine_rate = ma35d1_clkdiv_determine_rate,
        .set_rate = ma35d1_clkdiv_set_rate,
 };