]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/sun4i/sun4i_hdmi_ddc_clk: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Mon, 11 Aug 2025 10:56:12 +0000 (06:56 -0400)
committerRaphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Mon, 15 Sep 2025 13:08:44 +0000 (15:08 +0200)
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>
drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c

index 12430b9d4e930f7e7b0536a5cabdf788ba182176..b1beadb9bb59f8fffd23fd5f1a175d7385cd5e06 100644 (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,
 };