]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
clk: tegra: audio-sync: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Wed, 3 Sep 2025 15:15:02 +0000 (11:15 -0400)
committerBrian Masney <bmasney@redhat.com>
Mon, 8 Sep 2025 16:50:34 +0000 (12:50 -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/tegra/clk-audio-sync.c

index 2c4bb96eae16e2d4da8740d4596cdb562fd65e73..468a4403f147a2bfbff65b34df8b80a0095eed15 100644 (file)
@@ -17,15 +17,15 @@ static unsigned long clk_sync_source_recalc_rate(struct clk_hw *hw,
        return sync->rate;
 }
 
-static long clk_sync_source_round_rate(struct clk_hw *hw, unsigned long rate,
-                                      unsigned long *prate)
+static int clk_sync_source_determine_rate(struct clk_hw *hw,
+                                         struct clk_rate_request *req)
 {
        struct tegra_clk_sync_source *sync = to_clk_sync_source(hw);
 
-       if (rate > sync->max_rate)
+       if (req->rate > sync->max_rate)
                return -EINVAL;
        else
-               return rate;
+               return 0;
 }
 
 static int clk_sync_source_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -38,7 +38,7 @@ static int clk_sync_source_set_rate(struct clk_hw *hw, unsigned long rate,
 }
 
 const struct clk_ops tegra_clk_sync_source_ops = {
-       .round_rate = clk_sync_source_round_rate,
+       .determine_rate = clk_sync_source_determine_rate,
        .set_rate = clk_sync_source_set_rate,
        .recalc_rate = clk_sync_source_recalc_rate,
 };