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

clk: spacemit: ccu_ddn: 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-49-b3bf97b038dc@redhat.com
Signed-off-by: Yixun Lan <dlan@gentoo.org>

authored by

Brian Masney and committed by
Yixun Lan
b4a7b0d2 c536e00d

+7 -4
+7 -4
drivers/clk/spacemit/ccu_ddn.c
··· 39 39 return ccu_ddn_calc_rate(prate, *num, *den); 40 40 } 41 41 42 - static long ccu_ddn_round_rate(struct clk_hw *hw, unsigned long rate, 43 - unsigned long *prate) 42 + static int ccu_ddn_determine_rate(struct clk_hw *hw, 43 + struct clk_rate_request *req) 44 44 { 45 45 struct ccu_ddn *ddn = hw_to_ccu_ddn(hw); 46 46 unsigned long num, den; 47 47 48 - return ccu_ddn_calc_best_rate(ddn, rate, *prate, &num, &den); 48 + req->rate = ccu_ddn_calc_best_rate(ddn, req->rate, 49 + req->best_parent_rate, &num, &den); 50 + 51 + return 0; 49 52 } 50 53 51 54 static unsigned long ccu_ddn_recalc_rate(struct clk_hw *hw, unsigned long prate) ··· 81 78 82 79 const struct clk_ops spacemit_ccu_ddn_ops = { 83 80 .recalc_rate = ccu_ddn_recalc_rate, 84 - .round_rate = ccu_ddn_round_rate, 81 + .determine_rate = ccu_ddn_determine_rate, 85 82 .set_rate = ccu_ddn_set_rate, 86 83 };