]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: freescale: phy-fsl-samsung-hdmi: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Thu, 11 Dec 2025 23:16:19 +0000 (08:16 +0900)
committerVinod Koul <vkoul@kernel.org>
Wed, 24 Dec 2025 07:23:35 +0000 (12:53 +0530)
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>
Link: https://patch.msgid.link/20251212-phy-clk-round-rate-v3-1-beae3962f767@redhat.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/freescale/phy-fsl-samsung-hdmi.c

index 191c282246d96e3f6c5a8d17abe078892882bf44..d010fec15671d33cc363af79e9f1c3f26ecb3464 100644 (file)
@@ -570,17 +570,20 @@ const struct phy_config *fsl_samsung_hdmi_phy_find_settings(struct fsl_samsung_h
        return fract_div_phy;
 }
 
-static long fsl_samsung_hdmi_phy_clk_round_rate(struct clk_hw *hw,
-                                               unsigned long rate, unsigned long *parent_rate)
+static int fsl_samsung_hdmi_phy_clk_determine_rate(struct clk_hw *hw,
+                                                  struct clk_rate_request *req)
 {
        struct fsl_samsung_hdmi_phy *phy = to_fsl_samsung_hdmi_phy(hw);
-       const struct phy_config *target_settings = fsl_samsung_hdmi_phy_find_settings(phy, rate);
+       const struct phy_config *target_settings = fsl_samsung_hdmi_phy_find_settings(phy,
+                                                                                     req->rate);
 
        if (target_settings == NULL)
                return -EINVAL;
 
        dev_dbg(phy->dev, "round_rate, closest rate = %u\n", target_settings->pixclk);
-       return target_settings->pixclk;
+       req->rate = target_settings->pixclk;
+
+       return 0;
 }
 
 static int fsl_samsung_hdmi_phy_clk_set_rate(struct clk_hw *hw,
@@ -599,7 +602,7 @@ static int fsl_samsung_hdmi_phy_clk_set_rate(struct clk_hw *hw,
 
 static const struct clk_ops phy_clk_ops = {
        .recalc_rate = phy_clk_recalc_rate,
-       .round_rate = fsl_samsung_hdmi_phy_clk_round_rate,
+       .determine_rate = fsl_samsung_hdmi_phy_clk_determine_rate,
        .set_rate = fsl_samsung_hdmi_phy_clk_set_rate,
 };