Re: [PATCH 051/114] clk: spacemit: ccu_pll: convert from round_rate() to determine_rate()

Yixun Lan <[email protected]>
Newsgroups dev.linux.lists.sophgo,dev.linux.lists.asahi,dev.linux.lists.imx,dev.linux.lists.soc,dev.linux.lists.spacemit,org.infradead.lists.linux-mediatek,org.infradead.lists.linux-riscv,org.infradead.lists.linux-rockchip,org.kernel.vger.arm-scmi,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-clk,org.kernel.vger.linux-kernel,org.kernel.vger.linux-mips,org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-samsung-soc
Message-ID <[email protected]>
Hi Brian,

On 11:18 Mon 11 Aug     , Brian Masney via B4 Relay wrote:
> From: Brian Masney <[email protected]>
> 
> 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 <[email protected]>

Reviewed-by: Yixun Lan <[email protected]>
> ---
>  drivers/clk/spacemit/ccu_pll.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/spacemit/ccu_pll.c b/drivers/clk/spacemit/ccu_pll.c
> index 45f540073a656c0edc341a903acc3f2405971fc9..d92f0dae65a490e9db52f25a538a518baa487ea8 100644
> --- a/drivers/clk/spacemit/ccu_pll.c
> +++ b/drivers/clk/spacemit/ccu_pll.c
> @@ -125,12 +125,14 @@ static unsigned long ccu_pll_recalc_rate(struct clk_hw *hw,
>  	return entry ? entry->rate : 0;
>  }
>  
> -static long ccu_pll_round_rate(struct clk_hw *hw, unsigned long rate,
> -			       unsigned long *prate)
> +static int ccu_pll_determine_rate(struct clk_hw *hw,
> +				  struct clk_rate_request *req)
>  {
>  	struct ccu_pll *pll = hw_to_ccu_pll(hw);
>  
> -	return ccu_pll_lookup_best_rate(pll, rate)->rate;
> +	req->rate = ccu_pll_lookup_best_rate(pll, req->rate)->rate;
> +
> +	return 0;
>  }
>  
>  static int ccu_pll_init(struct clk_hw *hw)
> @@ -152,6 +154,6 @@ const struct clk_ops spacemit_ccu_pll_ops = {
>  	.disable	= ccu_pll_disable,
>  	.set_rate	= ccu_pll_set_rate,
>  	.recalc_rate	= ccu_pll_recalc_rate,
> -	.round_rate	= ccu_pll_round_rate,
> +	.determine_rate = ccu_pll_determine_rate,
>  	.is_enabled	= ccu_pll_is_enabled,
>  };
> 
> -- 
> 2.50.1
> 
> 

-- 
Yixun Lan (dlan)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.