[PATCH 110/114] clk: visconti: pll: convert from round_rate() to determine_rate()
nobuhiro1.iwamatsu at toshiba.co.jp
nobuhiro1.iwamatsu at toshiba.co.jp
Sun Aug 17 17:48:10 PDT 2025
> Subject: [PATCH 110/114] clk: visconti: pll: convert from round_rate() to
> determine_rate()
>
> From: Brian Masney <bmasney at redhat.com>
>
> 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 at redhat.com>
Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu at toshiba.co.jp>
> ---
> drivers/clk/visconti/pll.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/clk/visconti/pll.c b/drivers/clk/visconti/pll.c index
> 8ca1bad61864204027b7aff9020f1cb9e7d198d3..681721d8503203de9ac49ac32
> 07e121bb5bf2163 100644
> --- a/drivers/clk/visconti/pll.c
> +++ b/drivers/clk/visconti/pll.c
> @@ -100,8 +100,8 @@ static unsigned long
> visconti_get_pll_rate_from_data(struct visconti_pll *pll,
> return rate_table[0].rate;
> }
>
> -static long visconti_pll_round_rate(struct clk_hw *hw,
> - unsigned long rate, unsigned long *prate)
> +static int visconti_pll_determine_rate(struct clk_hw *hw,
> + struct clk_rate_request *req)
> {
> struct visconti_pll *pll = to_visconti_pll(hw);
> const struct visconti_pll_rate_table *rate_table = pll->rate_table; @@
> -109,11 +109,16 @@ static long visconti_pll_round_rate(struct clk_hw *hw,
>
> /* Assuming rate_table is in descending order */
> for (i = 0; i < pll->rate_count; i++)
> - if (rate >= rate_table[i].rate)
> - return rate_table[i].rate;
> + if (req->rate >= rate_table[i].rate) {
> + req->rate = rate_table[i].rate;
> +
> + return 0;
> + }
>
> /* return minimum supported value */
> - return rate_table[i - 1].rate;
> + req->rate = rate_table[i - 1].rate;
> +
> + return 0;
> }
>
> static unsigned long visconti_pll_recalc_rate(struct clk_hw *hw, @@ -232,7
> +237,7 @@ static const struct clk_ops visconti_pll_ops = {
> .enable = visconti_pll_enable,
> .disable = visconti_pll_disable,
> .is_enabled = visconti_pll_is_enabled,
> - .round_rate = visconti_pll_round_rate,
> + .determine_rate = visconti_pll_determine_rate,
> .recalc_rate = visconti_pll_recalc_rate,
> .set_rate = visconti_pll_set_rate,
> };
>
> --
> 2.50.1
Best regards,
Nobuhiro
More information about the Linux-mediatek
mailing list