linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Masney <bmasney@redhat.com>
To: Michael Turquette <mturquette@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>,
	Vladimir Zapolskiy <vz@mleia.com>,
	 Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>,
	 Chen Wang <unicorn_wang@outlook.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,
	 Brian Masney <bmasney@redhat.com>
Subject: [PATCH 3/8] clk: rockchip: half-divider: convert from round_rate() to determine_rate()
Date: Thu, 28 Aug 2025 20:38:22 -0400	[thread overview]
Message-ID: <20250828-clk-round-rate-v2-v1-3-b97ec8ba6cc4@redhat.com> (raw)
In-Reply-To: <20250828-clk-round-rate-v2-v1-0-b97ec8ba6cc4@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@redhat.com>
---
 drivers/clk/rockchip/clk-half-divider.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/rockchip/clk-half-divider.c b/drivers/clk/rockchip/clk-half-divider.c
index 64f7faad2148f27099d1ace36da45207e2315a1c..fbc018e8afa44c87a5a7b53475fc98b318ce1ec8 100644
--- a/drivers/clk/rockchip/clk-half-divider.c
+++ b/drivers/clk/rockchip/clk-half-divider.c
@@ -92,17 +92,19 @@ static int clk_half_divider_bestdiv(struct clk_hw *hw, unsigned long rate,
 	return bestdiv;
 }
 
-static long clk_half_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-					unsigned long *prate)
+static int clk_half_divider_determine_rate(struct clk_hw *hw,
+					   struct clk_rate_request *req)
 {
 	struct clk_divider *divider = to_clk_divider(hw);
 	int div;
 
-	div = clk_half_divider_bestdiv(hw, rate, prate,
+	div = clk_half_divider_bestdiv(hw, req->rate, &req->best_parent_rate,
 				       divider->width,
 				       divider->flags);
 
-	return DIV_ROUND_UP_ULL(((u64)*prate * 2), div * 2 + 3);
+	req->rate = DIV_ROUND_UP_ULL(((u64)req->best_parent_rate * 2), div * 2 + 3);
+
+	return 0;
 }
 
 static int clk_half_divider_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -141,7 +143,7 @@ static int clk_half_divider_set_rate(struct clk_hw *hw, unsigned long rate,
 
 static const struct clk_ops clk_half_divider_ops = {
 	.recalc_rate = clk_half_divider_recalc_rate,
-	.round_rate = clk_half_divider_round_rate,
+	.determine_rate = clk_half_divider_determine_rate,
 	.set_rate = clk_half_divider_set_rate,
 };
 

-- 
2.50.1


  parent reply	other threads:[~2025-08-29  0:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29  0:38 [PATCH 0/8] clk: convert drivers from deprecated round_rate() to determine_rate() 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 ` Brian Masney [this message]
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
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

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=20250828-clk-round-rate-v2-v1-3-b97ec8ba6cc4@redhat.com \
    --to=bmasney@redhat.com \
    --cc=andersson@kernel.org \
    --cc=andrea.porta@suse.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=unicorn_wang@outlook.com \
    --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;
as well as URLs for NNTP newsgroup(s).