From nobody Sun Oct 5 01:46:16 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D13442E3371; Mon, 11 Aug 2025 15:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754925507; cv=none; b=ChGjIo3GXceu3/fNRK3tQv5u6hUq5wLkxIlQ+aWbBI5H2QdO+VW2GPomZ3Isg2M7hpkqDmelcTrwRBqTftt8a/NQqbXsPQG0eMBsX5qyWo8qKl5UazBqMxxiiQy+jSNwqbasSnya71SSeYFgzZQN3aizdGDiNy21sYk9k3m5rFQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754925507; c=relaxed/simple; bh=Qlrw2uRVlp0vGDYJY7MoY1jKx9FRqPHx5uCFYZ7JsmE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KLXirZmPYcnoc+d5GPXozsPlVovoY8BMgJSMtssUhi7cg5fvFEjZZZA1TYoIybaYpQ6fvbd5ztwsvtHF1lpckwWZ/XZ8KvVGSLXOJW5xNgz5+5leztImiGpCUBscMYU0lXlYO6e9gipQZeCHXH6XpvuPOqcRgjzjtbhAzuTVtJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uklCishU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uklCishU" Received: by smtp.kernel.org (Postfix) with ESMTPS id E2111C4DDE8; Mon, 11 Aug 2025 15:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1754925506; bh=Qlrw2uRVlp0vGDYJY7MoY1jKx9FRqPHx5uCFYZ7JsmE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uklCishUoIxOpo8h7B22wRQ5RAuC60Yz+J71/cSJyV1yE30qsM8NA0bpTAnOXO4Ae awz9KLYage9GvEh+4ZHjGvaWaa27lbqB7OupVRgwPStDKCnkM2H1B5O+TKhGQRE8eQ Xyp3mvYOg6CFEvgNHo/88l1FE+n50nCVo2xsKt2whkHzAgscZxAu4bWLVCLASjTPpU ju255uuSHrnpjCoef7r0CkMOmBUEGWv55gbT1qVkCaXTGhBFlZ/wbkuPL0zIaVMhKy ZSxycydyjU1S3s23xvdxTOZTmBjh2e/ScFLwVUMlV0w+D5+v4xEfAwAlu28nsdhKk/ phB1H3i4S/sgw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF3CBC87FDA; Mon, 11 Aug 2025 15:18:25 +0000 (UTC) From: Brian Masney via B4 Relay Date: Mon, 11 Aug 2025 11:18:02 -0400 Subject: [PATCH 010/114] clk: baikal-t1: ccu-div: convert from round_rate() to determine_rate() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250811-clk-for-stephen-round-rate-v1-10-b3bf97b038dc@redhat.com> References: <20250811-clk-for-stephen-round-rate-v1-0-b3bf97b038dc@redhat.com> In-Reply-To: <20250811-clk-for-stephen-round-rate-v1-0-b3bf97b038dc@redhat.com> To: Michael Turquette , Stephen Boyd , Sudeep Holla , Cristian Marussi , Chen Wang , Inochi Amaoto , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Paul Cercueil , Keguang Zhang , Taichi Sugaya , Takao Orito , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Jacky Huang , Shan-Chun Hung , Vladimir Zapolskiy , Piotr Wojtaszczyk , Paul Walmsley , Samuel Holland , Yixun Lan , Steen Hegelund , Daniel Machon , UNGLinuxDriver@microchip.com, Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , Michal Simek , Maxime Ripard , =?utf-8?q?Andreas_F=C3=A4rber?= , Manivannan Sadhasivam , Sven Peter , Janne Grunau , Alyssa Rosenzweig , Neal Gompa , Eugeniy Paltsev , Ray Jui , Scott Branden , Broadcom internal kernel review list , Max Filippov , Matthias Brugger , AngeloGioacchino Del Regno , Daniel Palmer , Romain Perier , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Bjorn Andersson , Geert Uytterhoeven , Heiko Stuebner , Andrea della Porta , Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi , Alim Akhtar , Qin Jian , Viresh Kumar , Ulf Hansson , Luca Ceresoli , Alex Helms , Linus Walleij , Liviu Dudau , Lorenzo Pieralisi , Nobuhiro Iwamatsu Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sophgo@lists.linux.dev, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, patches@opensource.cirrus.com, linux-actions@lists.infradead.org, asahi@lists.linux.dev, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, soc@lists.linux.dev, Brian Masney X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1754925497; l=3389; i=bmasney@redhat.com; s=20250528; h=from:subject:message-id; bh=nym5XjLemEq228LpveT5/ErTWDImRURr5JDDhbNCaL4=; b=0DjaR6QeYFxaDSfXoLB4Aix+g0nTT6SM4/R0Dv/DY/yjG/canwRVCudYkR3wHhI7WlX+hA0kw 4DoiM292XomCrmp7d4tu+5my/w0Aqv5x0RdRRKBTga+DlCAK2UZP2pT X-Developer-Key: i=bmasney@redhat.com; a=ed25519; pk=x20f2BQYftANnik+wvlm4HqLqAlNs/npfVcbhHPOK2U= X-Endpoint-Received: by B4 Relay for bmasney@redhat.com/20250528 with auth_id=472 X-Original-From: Brian Masney Reply-To: bmasney@redhat.com From: Brian Masney 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 --- drivers/clk/baikal-t1/ccu-div.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/clk/baikal-t1/ccu-div.c b/drivers/clk/baikal-t1/ccu-di= v.c index 8d5fc7158f33f9c5f8a04241cb62f1ec6ced6e5d..849d1f55765f503c23954754b99= 4d1c28fe3f525 100644 --- a/drivers/clk/baikal-t1/ccu-div.c +++ b/drivers/clk/baikal-t1/ccu-div.c @@ -228,15 +228,18 @@ static inline unsigned long ccu_div_var_calc_divider(= unsigned long rate, CCU_DIV_CLKDIV_MAX(mask)); } =20 -static long ccu_div_var_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *parent_rate) +static int ccu_div_var_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { struct ccu_div *div =3D to_ccu_div(hw); unsigned long divider; =20 - divider =3D ccu_div_var_calc_divider(rate, *parent_rate, div->mask); + divider =3D ccu_div_var_calc_divider(req->rate, req->best_parent_rate, + div->mask); =20 - return ccu_div_calc_freq(*parent_rate, divider); + req->rate =3D ccu_div_calc_freq(req->best_parent_rate, divider); + + return 0; } =20 /* @@ -308,12 +311,14 @@ static unsigned long ccu_div_fixed_recalc_rate(struct= clk_hw *hw, return ccu_div_calc_freq(parent_rate, div->divider); } =20 -static long ccu_div_fixed_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *parent_rate) +static int ccu_div_fixed_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { struct ccu_div *div =3D to_ccu_div(hw); =20 - return ccu_div_calc_freq(*parent_rate, div->divider); + req->rate =3D ccu_div_calc_freq(req->best_parent_rate, div->divider); + + return 0; } =20 static int ccu_div_fixed_set_rate(struct clk_hw *hw, unsigned long rate, @@ -534,14 +539,14 @@ static const struct clk_ops ccu_div_var_gate_to_set_o= ps =3D { .disable =3D ccu_div_gate_disable, .is_enabled =3D ccu_div_gate_is_enabled, .recalc_rate =3D ccu_div_var_recalc_rate, - .round_rate =3D ccu_div_var_round_rate, + .determine_rate =3D ccu_div_var_determine_rate, .set_rate =3D ccu_div_var_set_rate_fast, .debug_init =3D ccu_div_var_debug_init }; =20 static const struct clk_ops ccu_div_var_nogate_ops =3D { .recalc_rate =3D ccu_div_var_recalc_rate, - .round_rate =3D ccu_div_var_round_rate, + .determine_rate =3D ccu_div_var_determine_rate, .set_rate =3D ccu_div_var_set_rate_slow, .debug_init =3D ccu_div_var_debug_init }; @@ -551,7 +556,7 @@ static const struct clk_ops ccu_div_gate_ops =3D { .disable =3D ccu_div_gate_disable, .is_enabled =3D ccu_div_gate_is_enabled, .recalc_rate =3D ccu_div_fixed_recalc_rate, - .round_rate =3D ccu_div_fixed_round_rate, + .determine_rate =3D ccu_div_fixed_determine_rate, .set_rate =3D ccu_div_fixed_set_rate, .debug_init =3D ccu_div_gate_debug_init }; @@ -565,7 +570,7 @@ static const struct clk_ops ccu_div_buf_ops =3D { =20 static const struct clk_ops ccu_div_fixed_ops =3D { .recalc_rate =3D ccu_div_fixed_recalc_rate, - .round_rate =3D ccu_div_fixed_round_rate, + .determine_rate =3D ccu_div_fixed_determine_rate, .set_rate =3D ccu_div_fixed_set_rate, .debug_init =3D ccu_div_fixed_debug_init }; --=20 2.50.1