Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Brian Masney and committed by
Raphael Gallais-Pou
5c04f481 1dc50bc8

+7 -5
+7 -5
drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
··· 59 59 return best_rate; 60 60 } 61 61 62 - static long sun4i_ddc_round_rate(struct clk_hw *hw, unsigned long rate, 63 - unsigned long *prate) 62 + static int sun4i_ddc_determine_rate(struct clk_hw *hw, 63 + struct clk_rate_request *req) 64 64 { 65 65 struct sun4i_ddc *ddc = hw_to_ddc(hw); 66 66 67 - return sun4i_ddc_calc_divider(rate, *prate, ddc->pre_div, 68 - ddc->m_offset, NULL, NULL); 67 + req->rate = sun4i_ddc_calc_divider(req->rate, req->best_parent_rate, 68 + ddc->pre_div, ddc->m_offset, NULL, NULL); 69 + 70 + return 0; 69 71 } 70 72 71 73 static unsigned long sun4i_ddc_recalc_rate(struct clk_hw *hw, ··· 103 101 104 102 static const struct clk_ops sun4i_ddc_ops = { 105 103 .recalc_rate = sun4i_ddc_recalc_rate, 106 - .round_rate = sun4i_ddc_round_rate, 104 + .determine_rate = sun4i_ddc_determine_rate, 107 105 .set_rate = sun4i_ddc_set_rate, 108 106 }; 109 107