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

index a3467aa6790f36e3f5eaf84853b4710804c6c11a..f9f060d08a5fae3291a9408c6dc93531b435609f 100644 (file)
@@ -93,14 +93,16 @@ static unsigned long ls1x_divider_recalc_rate(struct clk_hw *hw,
                                   d->flags, d->width);
 }
 
-static long ls1x_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-                                   unsigned long *prate)
+static int ls1x_divider_determine_rate(struct clk_hw *hw,
+                                      struct clk_rate_request *req)
 {
        struct ls1x_clk *ls1x_clk = to_ls1x_clk(hw);
        const struct ls1x_clk_div_data *d = ls1x_clk->data;
 
-       return divider_round_rate(hw, rate, prate, d->table,
-                                 d->width, d->flags);
+       req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
+                                      d->table, d->width, d->flags);
+
+       return 0;
 }
 
 static int ls1x_divider_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -146,7 +148,7 @@ static int ls1x_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops ls1x_clk_divider_ops = {
        .recalc_rate = ls1x_divider_recalc_rate,
-       .round_rate = ls1x_divider_round_rate,
+       .determine_rate = ls1x_divider_determine_rate,
        .set_rate = ls1x_divider_set_rate,
 };