]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pmdomain: mediatek: airoha: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Sun, 10 Aug 2025 22:16:19 +0000 (18:16 -0400)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 17 Sep 2025 14:28:18 +0000 (16:28 +0200)
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.

Note that prior to running the Coccinelle,
airoha_cpu_pmdomain_clk_round() was renamed to
airoha_cpu_pmdomain_clk_round_rate().

Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c

index 0fd88d2f9ac29da371590ee3af92c1260e4f2f5f..3b1d202f89dc516922887cdd968c95f5147491f4 100644 (file)
@@ -21,10 +21,10 @@ struct airoha_cpu_pmdomain_priv {
        struct generic_pm_domain pd;
 };
 
-static long airoha_cpu_pmdomain_clk_round(struct clk_hw *hw, unsigned long rate,
-                                         unsigned long *parent_rate)
+static int airoha_cpu_pmdomain_clk_determine_rate(struct clk_hw *hw,
+                                                 struct clk_rate_request *req)
 {
-       return rate;
+       return 0;
 }
 
 static unsigned long airoha_cpu_pmdomain_clk_get(struct clk_hw *hw,
@@ -48,7 +48,7 @@ static int airoha_cpu_pmdomain_clk_is_enabled(struct clk_hw *hw)
 static const struct clk_ops airoha_cpu_pmdomain_clk_ops = {
        .recalc_rate = airoha_cpu_pmdomain_clk_get,
        .is_enabled = airoha_cpu_pmdomain_clk_is_enabled,
-       .round_rate = airoha_cpu_pmdomain_clk_round,
+       .determine_rate = airoha_cpu_pmdomain_clk_determine_rate,
 };
 
 static int airoha_cpu_pmdomain_set_performance_state(struct generic_pm_domain *domain,