]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: ti: phy-j721e-wiz: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Thu, 11 Dec 2025 23:16:27 +0000 (08:16 +0900)
committerVinod Koul <vkoul@kernel.org>
Wed, 24 Dec 2025 07:23:36 +0000 (12:53 +0530)
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>
Link: https://patch.msgid.link/20251212-phy-clk-round-rate-v3-9-beae3962f767@redhat.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/ti/phy-j721e-wiz.c

index ba31b0a1f7f79b957b4f1d34f4064be659b9bc35..12a19bf2875c601c60ff5559e1554274ee215918 100644 (file)
@@ -935,12 +935,15 @@ static unsigned long wiz_clk_div_recalc_rate(struct clk_hw *hw,
        return divider_recalc_rate(hw, parent_rate, val, div->table, 0x0, 2);
 }
 
-static long wiz_clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
-                                  unsigned long *prate)
+static int wiz_clk_div_determine_rate(struct clk_hw *hw,
+                                     struct clk_rate_request *req)
 {
        struct wiz_clk_divider *div = to_wiz_clk_div(hw);
 
-       return divider_round_rate(hw, rate, prate, div->table, 2, 0x0);
+       req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+                                      div->table, 2, 0x0);
+
+       return 0;
 }
 
 static int wiz_clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -959,7 +962,7 @@ static int wiz_clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops wiz_clk_div_ops = {
        .recalc_rate = wiz_clk_div_recalc_rate,
-       .round_rate = wiz_clk_div_round_rate,
+       .determine_rate = wiz_clk_div_determine_rate,
        .set_rate = wiz_clk_div_set_rate,
 };