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

index 38f44b5b9b1b80bf5404bcafda9806a5f377ed95..9511248c6bc9849b66f6d0aff86dd657e64ab396 100644 (file)
@@ -146,12 +146,14 @@ static unsigned int tps68470_clk_cfg_lookup(unsigned long rate)
        return best_idx;
 }
 
-static long tps68470_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-                                   unsigned long *parent_rate)
+static int tps68470_clk_determine_rate(struct clk_hw *hw,
+                                      struct clk_rate_request *req)
 {
-       unsigned int idx = tps68470_clk_cfg_lookup(rate);
+       unsigned int idx = tps68470_clk_cfg_lookup(req->rate);
+
+       req->rate = clk_freqs[idx].freq;
 
-       return clk_freqs[idx].freq;
+       return 0;
 }
 
 static int tps68470_clk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -186,7 +188,7 @@ static const struct clk_ops tps68470_clk_ops = {
        .prepare = tps68470_clk_prepare,
        .unprepare = tps68470_clk_unprepare,
        .recalc_rate = tps68470_clk_recalc_rate,
-       .round_rate = tps68470_clk_round_rate,
+       .determine_rate = tps68470_clk_determine_rate,
        .set_rate = tps68470_clk_set_rate,
 };