Re: [PATCH 079/114] clk: bm1880: convert from round_rate() to determine_rate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 11, 2025 at 11:19:11AM GMT, Brian Masney via B4 Relay wrote:
> From: Brian Masney <bmasney@xxxxxxxxxx>
> 
> 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.
> 

Once this patch gets merged, the 'Coccinelle semantic patch on the cover letter
of this series' becomes irrelevant. I'd suggest to either include the script
here or do not mention it at all.

- Mani

> Signed-off-by: Brian Masney <bmasney@xxxxxxxxxx>
> ---
>  drivers/clk/clk-bm1880.c | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clk/clk-bm1880.c b/drivers/clk/clk-bm1880.c
> index 002f7360b1c6c6e3058606a0808115b48fd3147a..dac190bc6e19a6dd4be413ea52d41f74934a1aa9 100644
> --- a/drivers/clk/clk-bm1880.c
> +++ b/drivers/clk/clk-bm1880.c
> @@ -608,8 +608,8 @@ static unsigned long bm1880_clk_div_recalc_rate(struct clk_hw *hw,
>  	return rate;
>  }
>  
> -static long bm1880_clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
> -				      unsigned long *prate)
> +static int bm1880_clk_div_determine_rate(struct clk_hw *hw,
> +					 struct clk_rate_request *req)
>  {
>  	struct bm1880_div_hw_clock *div_hw = to_bm1880_div_clk(hw);
>  	struct bm1880_div_clock *div = &div_hw->div;
> @@ -621,13 +621,18 @@ static long bm1880_clk_div_round_rate(struct clk_hw *hw, unsigned long rate,
>  		val = readl(reg_addr) >> div->shift;
>  		val &= clk_div_mask(div->width);
>  
> -		return divider_ro_round_rate(hw, rate, prate, div->table,
> -					     div->width, div->flags,
> -					     val);
> +		req->rate = divider_ro_round_rate(hw, req->rate,
> +						  &req->best_parent_rate,
> +						  div->table,
> +						  div->width, div->flags, val);
> +
> +		return 0;
>  	}
>  
> -	return divider_round_rate(hw, rate, prate, div->table,
> -				  div->width, div->flags);
> +	req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
> +				       div->table, div->width, div->flags);
> +
> +	return 0;
>  }
>  
>  static int bm1880_clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
> @@ -665,7 +670,7 @@ static int bm1880_clk_div_set_rate(struct clk_hw *hw, unsigned long rate,
>  
>  static const struct clk_ops bm1880_clk_div_ops = {
>  	.recalc_rate = bm1880_clk_div_recalc_rate,
> -	.round_rate = bm1880_clk_div_round_rate,
> +	.determine_rate = bm1880_clk_div_determine_rate,
>  	.set_rate = bm1880_clk_div_set_rate,
>  };
>  
> 
> -- 
> 2.50.1
> 
> 

-- 
மணிவண்ணன் சதாசிவம்




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux for Synopsys ARC Processors]    
  • [Linux on Unisoc (RDA Micro) SoCs]     [Linux Actions SoC]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  •   Powered by Linux