drm/sun4i/sun4i_hdmi_ddc_clk: 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.

Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://lore.kernel.org/r/20250811-drm-clk-round-rate-v2-8-4a91ccf239cf@redhat.com
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
This commit is contained in:
Brian Masney 2025-08-11 06:56:12 -04:00 committed by Raphael Gallais-Pou
parent 1dc50bc8a3
commit 5c04f48127

View File

@ -59,13 +59,15 @@ static unsigned long sun4i_ddc_calc_divider(unsigned long rate,
return best_rate;
}
static long sun4i_ddc_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
static int sun4i_ddc_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct sun4i_ddc *ddc = hw_to_ddc(hw);
return sun4i_ddc_calc_divider(rate, *prate, ddc->pre_div,
ddc->m_offset, NULL, NULL);
req->rate = sun4i_ddc_calc_divider(req->rate, req->best_parent_rate,
ddc->pre_div, ddc->m_offset, NULL, NULL);
return 0;
}
static unsigned long sun4i_ddc_recalc_rate(struct clk_hw *hw,
@ -101,7 +103,7 @@ static int sun4i_ddc_set_rate(struct clk_hw *hw, unsigned long rate,
static const struct clk_ops sun4i_ddc_ops = {
.recalc_rate = sun4i_ddc_recalc_rate,
.round_rate = sun4i_ddc_round_rate,
.determine_rate = sun4i_ddc_determine_rate,
.set_rate = sun4i_ddc_set_rate,
};