Skip to content

Commit d02c71c

Browse files
masneybdlan17
authored andcommitted
clk: spacemit: ccu_pll: 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-51-b3bf97b038dc@redhat.com Signed-off-by: Yixun Lan <dlan@gentoo.org>
1 parent 56737ed commit d02c71c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/clk/spacemit/ccu_pll.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,14 @@ static unsigned long ccu_pll_recalc_rate(struct clk_hw *hw,
125125
return entry ? entry->rate : 0;
126126
}
127127

128-
static long ccu_pll_round_rate(struct clk_hw *hw, unsigned long rate,
129-
unsigned long *prate)
128+
static int ccu_pll_determine_rate(struct clk_hw *hw,
129+
struct clk_rate_request *req)
130130
{
131131
struct ccu_pll *pll = hw_to_ccu_pll(hw);
132132

133-
return ccu_pll_lookup_best_rate(pll, rate)->rate;
133+
req->rate = ccu_pll_lookup_best_rate(pll, req->rate)->rate;
134+
135+
return 0;
134136
}
135137

136138
static int ccu_pll_init(struct clk_hw *hw)
@@ -152,6 +154,6 @@ const struct clk_ops spacemit_ccu_pll_ops = {
152154
.disable = ccu_pll_disable,
153155
.set_rate = ccu_pll_set_rate,
154156
.recalc_rate = ccu_pll_recalc_rate,
155-
.round_rate = ccu_pll_round_rate,
157+
.determine_rate = ccu_pll_determine_rate,
156158
.is_enabled = ccu_pll_is_enabled,
157159
};

0 commit comments

Comments
 (0)