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

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
drivers/clk/ux500/clk-prcmu.c

index 5cbf24c94606081b0ec18c8aaa201ef89b54edf0..f775e18acd468d91cc2d6cf7a289bb722d614141 100644 (file)
@@ -53,11 +53,13 @@ static unsigned long clk_prcmu_recalc_rate(struct clk_hw *hw,
        return prcmu_clock_rate(clk->cg_sel);
 }
 
-static long clk_prcmu_round_rate(struct clk_hw *hw, unsigned long rate,
-                                unsigned long *parent_rate)
+static int clk_prcmu_determine_rate(struct clk_hw *hw,
+                                   struct clk_rate_request *req)
 {
        struct clk_prcmu *clk = to_clk_prcmu(hw);
-       return prcmu_round_clock_rate(clk->cg_sel, rate);
+       req->rate = prcmu_round_clock_rate(clk->cg_sel, req->rate);
+
+       return 0;
 }
 
 static int clk_prcmu_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -157,7 +159,7 @@ static const struct clk_ops clk_prcmu_scalable_ops = {
        .prepare = clk_prcmu_prepare,
        .unprepare = clk_prcmu_unprepare,
        .recalc_rate = clk_prcmu_recalc_rate,
-       .round_rate = clk_prcmu_round_rate,
+       .determine_rate = clk_prcmu_determine_rate,
        .set_rate = clk_prcmu_set_rate,
 };
 
@@ -169,7 +171,7 @@ static const struct clk_ops clk_prcmu_gate_ops = {
 
 static const struct clk_ops clk_prcmu_scalable_rate_ops = {
        .recalc_rate = clk_prcmu_recalc_rate,
-       .round_rate = clk_prcmu_round_rate,
+       .determine_rate = clk_prcmu_determine_rate,
        .set_rate = clk_prcmu_set_rate,
 };
 
@@ -187,7 +189,7 @@ static const struct clk_ops clk_prcmu_opp_volt_scalable_ops = {
        .prepare = clk_prcmu_opp_volt_prepare,
        .unprepare = clk_prcmu_opp_volt_unprepare,
        .recalc_rate = clk_prcmu_recalc_rate,
-       .round_rate = clk_prcmu_round_rate,
+       .determine_rate = clk_prcmu_determine_rate,
        .set_rate = clk_prcmu_set_rate,
 };