Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pmdomain: mediatek: airoha: convert from round_rate() to determine_rate()

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>

authored by

Brian Masney and committed by
Ulf Hansson
c60934d5 5b3a897c

+4 -4
+4 -4
drivers/pmdomain/mediatek/airoha-cpu-pmdomain.c
··· 21 21 struct generic_pm_domain pd; 22 22 }; 23 23 24 - static long airoha_cpu_pmdomain_clk_round(struct clk_hw *hw, unsigned long rate, 25 - unsigned long *parent_rate) 24 + static int airoha_cpu_pmdomain_clk_determine_rate(struct clk_hw *hw, 25 + struct clk_rate_request *req) 26 26 { 27 - return rate; 27 + return 0; 28 28 } 29 29 30 30 static unsigned long airoha_cpu_pmdomain_clk_get(struct clk_hw *hw, ··· 48 48 static const struct clk_ops airoha_cpu_pmdomain_clk_ops = { 49 49 .recalc_rate = airoha_cpu_pmdomain_clk_get, 50 50 .is_enabled = airoha_cpu_pmdomain_clk_is_enabled, 51 - .round_rate = airoha_cpu_pmdomain_clk_round, 51 + .determine_rate = airoha_cpu_pmdomain_clk_determine_rate, 52 52 }; 53 53 54 54 static int airoha_cpu_pmdomain_set_performance_state(struct generic_pm_domain *domain,