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

clk: spacemit: ccu_mix: 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
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Haylen Chu <heylenay@4d2.org>
Reviewed-by: Yixun Lan <dlan@kernel.org>
Link: https://lore.kernel.org/r/20250811-clk-for-stephen-round-rate-v1-50-b3bf97b038dc@redhat.com
Signed-off-by: Yixun Lan <dlan@gentoo.org>

authored by

Brian Masney and committed by
Yixun Lan
56737edd b4a7b0d2

+7 -5
+7 -5
drivers/clk/spacemit/ccu_mix.c
··· 80 80 MIX_FC_TIMEOUT_US); 81 81 } 82 82 83 - static long ccu_factor_round_rate(struct clk_hw *hw, unsigned long rate, 84 - unsigned long *prate) 83 + static int ccu_factor_determine_rate(struct clk_hw *hw, 84 + struct clk_rate_request *req) 85 85 { 86 - return ccu_factor_recalc_rate(hw, *prate); 86 + req->rate = ccu_factor_recalc_rate(hw, req->best_parent_rate); 87 + 88 + return 0; 87 89 } 88 90 89 91 static int ccu_factor_set_rate(struct clk_hw *hw, unsigned long rate, ··· 200 198 }; 201 199 202 200 const struct clk_ops spacemit_ccu_factor_ops = { 203 - .round_rate = ccu_factor_round_rate, 201 + .determine_rate = ccu_factor_determine_rate, 204 202 .recalc_rate = ccu_factor_recalc_rate, 205 203 .set_rate = ccu_factor_set_rate, 206 204 }; ··· 222 220 .enable = ccu_gate_enable, 223 221 .is_enabled = ccu_gate_is_enabled, 224 222 225 - .round_rate = ccu_factor_round_rate, 223 + .determine_rate = ccu_factor_determine_rate, 226 224 .recalc_rate = ccu_factor_recalc_rate, 227 225 .set_rate = ccu_factor_set_rate, 228 226 };