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

index c385ca2f4a744dff3c3e4cf30add2e80718075ad..9adbf5c33bd1cadab0968134ddee1d1061f61239 100644 (file)
@@ -33,18 +33,18 @@ static unsigned long vexpress_osc_recalc_rate(struct clk_hw *hw,
        return rate;
 }
 
-static long vexpress_osc_round_rate(struct clk_hw *hw, unsigned long rate,
-               unsigned long *parent_rate)
+static int vexpress_osc_determine_rate(struct clk_hw *hw,
+                                      struct clk_rate_request *req)
 {
        struct vexpress_osc *osc = to_vexpress_osc(hw);
 
-       if (osc->rate_min && rate < osc->rate_min)
-               rate = osc->rate_min;
+       if (osc->rate_min && req->rate < osc->rate_min)
+               req->rate = osc->rate_min;
 
-       if (osc->rate_max && rate > osc->rate_max)
-               rate = osc->rate_max;
+       if (osc->rate_max && req->rate > osc->rate_max)
+               req->rate = osc->rate_max;
 
-       return rate;
+       return 0;
 }
 
 static int vexpress_osc_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -57,7 +57,7 @@ static int vexpress_osc_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops vexpress_osc_ops = {
        .recalc_rate = vexpress_osc_recalc_rate,
-       .round_rate = vexpress_osc_round_rate,
+       .determine_rate = vexpress_osc_determine_rate,
        .set_rate = vexpress_osc_set_rate,
 };