Commit 5c04f481 authored by Brian Masney's avatar Brian Masney Committed by Raphael Gallais-Pou
Browse files

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: default avatarMaxime Ripard <mripard@kernel.org>
Signed-off-by: default avatarBrian Masney <bmasney@redhat.com>
Link: https://lore.kernel.org/r/20250811-drm-clk-round-rate-v2-8-4a91ccf239cf@redhat.com


Signed-off-by: default avatarRaphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
parent 1dc50bc8
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -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,
};