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>
This commit is contained in:
Brian Masney 2025-08-11 11:18:41 -04:00 committed by Yixun Lan
parent c536e00d58
commit b4a7b0d2c4
No known key found for this signature in database
GPG Key ID: 31AAEA47594DBBED

View File

@ -39,13 +39,16 @@ static unsigned long ccu_ddn_calc_best_rate(struct ccu_ddn *ddn,
return ccu_ddn_calc_rate(prate, *num, *den);
}
static long ccu_ddn_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
static int ccu_ddn_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct ccu_ddn *ddn = hw_to_ccu_ddn(hw);
unsigned long num, den;
return ccu_ddn_calc_best_rate(ddn, rate, *prate, &num, &den);
req->rate = ccu_ddn_calc_best_rate(ddn, req->rate,
req->best_parent_rate, &num, &den);
return 0;
}
static unsigned long ccu_ddn_recalc_rate(struct clk_hw *hw, unsigned long prate)
@ -78,6 +81,6 @@ static int ccu_ddn_set_rate(struct clk_hw *hw, unsigned long rate,
const struct clk_ops spacemit_ccu_ddn_ops = {
.recalc_rate = ccu_ddn_recalc_rate,
.round_rate = ccu_ddn_round_rate,
.determine_rate = ccu_ddn_determine_rate,
.set_rate = ccu_ddn_set_rate,
};