From: Chen Wang <unicorn_wang@outlook.com>
To: Brian Masney <bmasney@redhat.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Vladimir Zapolskiy <vz@mleia.com>,
Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>,
Inochi Amaoto <inochiama@gmail.com>,
Michal Simek <michal.simek@amd.com>,
Bjorn Andersson <andersson@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Andrea della Porta <andrea.porta@suse.com>,
Maxime Ripard <mripard@kernel.org>
Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, sophgo@lists.linux.dev,
linux-arm-msm@vger.kernel.org,
linux-rockchip@lists.infradead.org
Subject: Re: [PATCH 5/8] clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()
Date: Fri, 29 Aug 2025 11:10:15 +0800 [thread overview]
Message-ID: <MAUPR01MB11072DB589F1E6B1E18D329A6FE3AA@MAUPR01MB11072.INDPRD01.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20250828-clk-round-rate-v2-v1-5-b97ec8ba6cc4@redhat.com>
On 8/29/2025 8:38 AM, Brian Masney wrote:
> 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.
>
> Reviewed-by: Chen Wang <unicorn_wang@outlook.com>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
Tested-by: Chen Wang <unicorn_wang@outlook.com> # Pioneerbox
Thanks,
Chen
> ---
> drivers/clk/sophgo/clk-sg2042-clkgen.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clk/sophgo/clk-sg2042-clkgen.c b/drivers/clk/sophgo/clk-sg2042-clkgen.c
> index 9e61288d34f3757315702c355f2669577b29676f..683661b71787c9e5428b168502f6fbb30ea9f7da 100644
> --- a/drivers/clk/sophgo/clk-sg2042-clkgen.c
> +++ b/drivers/clk/sophgo/clk-sg2042-clkgen.c
> @@ -176,9 +176,8 @@ static unsigned long sg2042_clk_divider_recalc_rate(struct clk_hw *hw,
> return ret_rate;
> }
>
> -static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
> - unsigned long rate,
> - unsigned long *prate)
> +static int sg2042_clk_divider_determine_rate(struct clk_hw *hw,
> + struct clk_rate_request *req)
> {
> struct sg2042_divider_clock *divider = to_sg2042_clk_divider(hw);
> unsigned long ret_rate;
> @@ -192,15 +191,17 @@ static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
> bestdiv = readl(divider->reg) >> divider->shift;
> bestdiv &= clk_div_mask(divider->width);
> }
> - ret_rate = DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
> + ret_rate = DIV_ROUND_UP_ULL((u64)req->best_parent_rate, bestdiv);
> } else {
> - ret_rate = divider_round_rate(hw, rate, prate, NULL,
> + ret_rate = divider_round_rate(hw, req->rate, &req->best_parent_rate, NULL,
> divider->width, divider->div_flags);
> }
>
> pr_debug("--> %s: divider_round_rate: val = %ld\n",
> clk_hw_get_name(hw), ret_rate);
> - return ret_rate;
> + req->rate = ret_rate;
> +
> + return 0;
> }
>
> static int sg2042_clk_divider_set_rate(struct clk_hw *hw,
> @@ -258,13 +259,13 @@ static int sg2042_clk_divider_set_rate(struct clk_hw *hw,
>
> static const struct clk_ops sg2042_clk_divider_ops = {
> .recalc_rate = sg2042_clk_divider_recalc_rate,
> - .round_rate = sg2042_clk_divider_round_rate,
> + .determine_rate = sg2042_clk_divider_determine_rate,
> .set_rate = sg2042_clk_divider_set_rate,
> };
>
> static const struct clk_ops sg2042_clk_divider_ro_ops = {
> .recalc_rate = sg2042_clk_divider_recalc_rate,
> - .round_rate = sg2042_clk_divider_round_rate,
> + .determine_rate = sg2042_clk_divider_determine_rate,
> };
>
> /*
>
next prev parent reply other threads:[~2025-08-29 3:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 0:38 [PATCH 0/8] clk: convert drivers from deprecated " Brian Masney
2025-08-29 0:38 ` [PATCH 1/8] clk: nxp: lpc32xx: convert from " Brian Masney
2025-08-29 0:38 ` [PATCH 2/8] clk: qcom: alpha-pll: " Brian Masney
2025-08-29 0:38 ` [PATCH 3/8] clk: rockchip: half-divider: " Brian Masney
2025-08-29 0:38 ` [PATCH 4/8] clk: rp1: " Brian Masney
2025-09-04 18:28 ` Florian Fainelli
2025-08-29 0:38 ` [PATCH 5/8] clk: sophgo: sg2042-clkgen: " Brian Masney
2025-08-29 3:10 ` Chen Wang [this message]
2025-08-29 0:38 ` [PATCH 6/8] clk: sophgo: sg2042-pll: remove round_rate() in favor of determine_rate() Brian Masney
2025-08-29 3:11 ` Chen Wang
2025-08-29 0:38 ` [PATCH 7/8] clk: x86: cgu: convert from round_rate() to determine_rate() Brian Masney
2025-08-29 0:38 ` [PATCH 8/8] clk: zynqmp: divider: " Brian Masney
2025-09-04 14:35 ` (subset) [PATCH 0/8] clk: convert drivers from deprecated " Bjorn Andersson
2025-09-08 17:13 ` Brian Masney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MAUPR01MB11072DB589F1E6B1E18D329A6FE3AA@MAUPR01MB11072.INDPRD01.PROD.OUTLOOK.COM \
--to=unicorn_wang@outlook.com \
--cc=andersson@kernel.org \
--cc=andrea.porta@suse.com \
--cc=bmasney@redhat.com \
--cc=heiko@sntech.de \
--cc=inochiama@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=michal.simek@amd.com \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=piotr.wojtaszczyk@timesys.com \
--cc=sboyd@kernel.org \
--cc=sophgo@lists.linux.dev \
--cc=vz@mleia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®