Skip to content

Commit 56737ed

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

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

drivers/clk/spacemit/ccu_mix.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ static int ccu_mix_trigger_fc(struct clk_hw *hw)
8080
MIX_FC_TIMEOUT_US);
8181
}
8282

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)
8585
{
86-
return ccu_factor_recalc_rate(hw, *prate);
86+
req->rate = ccu_factor_recalc_rate(hw, req->best_parent_rate);
87+
88+
return 0;
8789
}
8890

8991
static int ccu_factor_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -198,7 +200,7 @@ const struct clk_ops spacemit_ccu_gate_ops = {
198200
};
199201

200202
const struct clk_ops spacemit_ccu_factor_ops = {
201-
.round_rate = ccu_factor_round_rate,
203+
.determine_rate = ccu_factor_determine_rate,
202204
.recalc_rate = ccu_factor_recalc_rate,
203205
.set_rate = ccu_factor_set_rate,
204206
};
@@ -220,7 +222,7 @@ const struct clk_ops spacemit_ccu_factor_gate_ops = {
220222
.enable = ccu_gate_enable,
221223
.is_enabled = ccu_gate_is_enabled,
222224

223-
.round_rate = ccu_factor_round_rate,
225+
.determine_rate = ccu_factor_determine_rate,
224226
.recalc_rate = ccu_factor_recalc_rate,
225227
.set_rate = ccu_factor_set_rate,
226228
};

0 commit comments

Comments
 (0)