]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
peci: controller: peci-aspeed: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Sun, 10 Aug 2025 22:21:51 +0000 (18:21 -0400)
committerIwona Winiarska <iwona.winiarska@intel.com>
Thu, 6 Nov 2025 13:51:37 +0000 (14:51 +0100)
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
appended to the "under-the-cut" portion of the patch.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com>
Link: https://lore.kernel.org/r/20250810-peci-round-rate-v1-1-ec96d216a455@redhat.com
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
drivers/peci/controller/peci-aspeed.c

index ad3a7d71ed4c61e6123dcbbad264812cb83cbb07..a0c99ecf7f3805a1cdac55a8d5db9c61ad3cf37c 100644 (file)
@@ -362,12 +362,14 @@ static int clk_aspeed_peci_set_rate(struct clk_hw *hw, unsigned long rate,
        return 0;
 }
 
-static long clk_aspeed_peci_round_rate(struct clk_hw *hw, unsigned long rate,
-                                      unsigned long *prate)
+static int clk_aspeed_peci_determine_rate(struct clk_hw *hw,
+                                         struct clk_rate_request *req)
 {
-       int div = clk_aspeed_peci_get_div(rate, prate);
+       int div = clk_aspeed_peci_get_div(req->rate, &req->best_parent_rate);
 
-       return DIV_ROUND_UP_ULL(*prate, div);
+       req->rate = DIV_ROUND_UP_ULL(req->best_parent_rate, div);
+
+       return 0;
 }
 
 static unsigned long clk_aspeed_peci_recalc_rate(struct clk_hw *hw, unsigned long prate)
@@ -394,7 +396,7 @@ static unsigned long clk_aspeed_peci_recalc_rate(struct clk_hw *hw, unsigned lon
 
 static const struct clk_ops clk_aspeed_peci_ops = {
        .set_rate = clk_aspeed_peci_set_rate,
-       .round_rate = clk_aspeed_peci_round_rate,
+       .determine_rate = clk_aspeed_peci_determine_rate,
        .recalc_rate = clk_aspeed_peci_recalc_rate,
 };