Skip to content

Commit b4a7b0d

Browse files
masneybdlan17
authored andcommitted
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>
1 parent c536e00 commit b4a7b0d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/clk/spacemit/ccu_ddn.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ static unsigned long ccu_ddn_calc_best_rate(struct ccu_ddn *ddn,
3939
return ccu_ddn_calc_rate(prate, *num, *den);
4040
}
4141

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)
4444
{
4545
struct ccu_ddn *ddn = hw_to_ccu_ddn(hw);
4646
unsigned long num, den;
4747

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;
4952
}
5053

5154
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,
7881

7982
const struct clk_ops spacemit_ccu_ddn_ops = {
8083
.recalc_rate = ccu_ddn_recalc_rate,
81-
.round_rate = ccu_ddn_round_rate,
84+
.determine_rate = ccu_ddn_determine_rate,
8285
.set_rate = ccu_ddn_set_rate,
8386
};

0 commit comments

Comments
 (0)