Re: [PATCH 050/114] clk: spacemit: ccu_mix: 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_mix.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/spacemit/ccu_mix.c b/drivers/clk/spacemit/ccu_mix.c
> index 9b852aa61f78aed5256bfe6fc3b01932d6db6256..7b7990875372314dce131295af7f40267d0a127a 100644
> --- a/drivers/clk/spacemit/ccu_mix.c
> +++ b/drivers/clk/spacemit/ccu_mix.c
> @@ -80,10 +80,12 @@ static int ccu_mix_trigger_fc(struct clk_hw *hw)
>  					       MIX_FC_TIMEOUT_US);
>  }
>  
> -static long ccu_factor_round_rate(struct clk_hw *hw, unsigned long rate,
> -				  unsigned long *prate)
> +static int ccu_factor_determine_rate(struct clk_hw *hw,
> +				     struct clk_rate_request *req)
>  {
> -	return ccu_factor_recalc_rate(hw, *prate);
> +	req->rate = ccu_factor_recalc_rate(hw, req->best_parent_rate);
> +
> +	return 0;
>  }
>  
>  static int ccu_factor_set_rate(struct clk_hw *hw, unsigned long rate,
> @@ -198,7 +200,7 @@ const struct clk_ops spacemit_ccu_gate_ops = {
>  };
>  
>  const struct clk_ops spacemit_ccu_factor_ops = {
> -	.round_rate	= ccu_factor_round_rate,
> +	.determine_rate = ccu_factor_determine_rate,
>  	.recalc_rate	= ccu_factor_recalc_rate,
>  	.set_rate	= ccu_factor_set_rate,
>  };
> @@ -220,7 +222,7 @@ const struct clk_ops spacemit_ccu_factor_gate_ops = {
>  	.enable		= ccu_gate_enable,
>  	.is_enabled	= ccu_gate_is_enabled,
>  
> -	.round_rate	= ccu_factor_round_rate,
> +	.determine_rate = ccu_factor_determine_rate,
>  	.recalc_rate	= ccu_factor_recalc_rate,
>  	.set_rate	= ccu_factor_set_rate,
>  };
> 
> -- 
> 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.