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

index 155f313986b40f15b7c426f4d49b1ed560acf9c3..869690b79cc16f05d63383b965ae5fc96deee79f 100644 (file)
@@ -56,8 +56,8 @@ static const struct clk_pll_table *_get_pll_table(
        return table;
 }
 
-static long owl_pll_round_rate(struct clk_hw *hw, unsigned long rate,
-               unsigned long *parent_rate)
+static int owl_pll_determine_rate(struct clk_hw *hw,
+                                 struct clk_rate_request *req)
 {
        struct owl_pll *pll = hw_to_owl_pll(hw);
        struct owl_pll_hw *pll_hw = &pll->pll_hw;
@@ -65,17 +65,24 @@ static long owl_pll_round_rate(struct clk_hw *hw, unsigned long rate,
        u32 mul;
 
        if (pll_hw->table) {
-               clkt = _get_pll_table(pll_hw->table, rate);
-               return clkt->rate;
+               clkt = _get_pll_table(pll_hw->table, req->rate);
+               req->rate = clkt->rate;
+
+               return 0;
        }
 
        /* fixed frequency */
-       if (pll_hw->width == 0)
-               return pll_hw->bfreq;
+       if (pll_hw->width == 0) {
+               req->rate = pll_hw->bfreq;
 
-       mul = owl_pll_calculate_mul(pll_hw, rate);
+               return 0;
+       }
+
+       mul = owl_pll_calculate_mul(pll_hw, req->rate);
 
-       return pll_hw->bfreq * mul;
+       req->rate = pll_hw->bfreq * mul;
+
+       return 0;
 }
 
 static unsigned long owl_pll_recalc_rate(struct clk_hw *hw,
@@ -188,7 +195,7 @@ const struct clk_ops owl_pll_ops = {
        .enable = owl_pll_enable,
        .disable = owl_pll_disable,
        .is_enabled = owl_pll_is_enabled,
-       .round_rate = owl_pll_round_rate,
+       .determine_rate = owl_pll_determine_rate,
        .recalc_rate = owl_pll_recalc_rate,
        .set_rate = owl_pll_set_rate,
 };