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

index 5348bafe694f0dacf30a59af92606c56efdb443b..6bae18a84cb6c0e19dd00762613fd9051849fdd0 100644 (file)
@@ -55,13 +55,15 @@ static unsigned long hi6220_clkdiv_recalc_rate(struct clk_hw *hw,
                                   CLK_DIVIDER_ROUND_CLOSEST, dclk->width);
 }
 
-static long hi6220_clkdiv_round_rate(struct clk_hw *hw, unsigned long rate,
-                                       unsigned long *prate)
+static int hi6220_clkdiv_determine_rate(struct clk_hw *hw,
+                                       struct clk_rate_request *req)
 {
        struct hi6220_clk_divider *dclk = to_hi6220_clk_divider(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 hi6220_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -93,7 +95,7 @@ static int hi6220_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops hi6220_clkdiv_ops = {
        .recalc_rate = hi6220_clkdiv_recalc_rate,
-       .round_rate = hi6220_clkdiv_round_rate,
+       .determine_rate = hi6220_clkdiv_determine_rate,
        .set_rate = hi6220_clkdiv_set_rate,
 };