From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B216CA0ED1 for ; Mon, 18 Aug 2025 13:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vF8oVy6/ZMtowVhAnxsrKfpp6JXqFRBEiZTXs8imWKc=; b=cCQXZQCDy8+EXCDTfdYut9TOac u8gDMuvef2ji+vHQsD0jgxixUG1rrPO3YO1yBy8eGaE8xsnCw3J4eFv8owMK8UQiCjJ4M3rpKP9lI FYse4jvhHnZjYJsZTynFiljW7kUIdw9NSWQBZ7layRjFogJ40iTjhl2eR5jFb6lS6ft9Qgne1Oj32 3rxphZhEqq3aW9Nw1q1WEc2tO+YETzNivDCZEjON/iwETJ9oxJC2FyGpK4ouSG2oEBAAb91qJewUc YOGy66BMqj3Vimbf7PTnimtKp69BAGMpdAvvT57fKnAVvHAzlhyE8tE+iKC+VZkiUS8v6Jmhxc/zw uBvmWsuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uo08U-00000007coS-2GMq; Mon, 18 Aug 2025 13:42:54 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1unyl0-00000007JAm-0KQk; Mon, 18 Aug 2025 12:14:36 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57IBp2wx008182; Mon, 18 Aug 2025 14:13:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= vF8oVy6/ZMtowVhAnxsrKfpp6JXqFRBEiZTXs8imWKc=; b=PSxNhDdZaYr8EoNw 8aZMzG+HAc5zZ/G6iGzm7FWO+i9981Jvk6JfEpE+hG0VOKlKZPoIa46QiLFU4DYx sUznRsmqgIiHeCSbPJoiisAuzQzZ6hgkO4CmmJIHG7kce+fJ4nFBIscnYKnoIKbX 3aYq4auNUAVqWfPNpND0uGOiy/LN0NcMei0rDbyUEd+d+AzIAj5hnYsC2UnS0xR7 owFelE/4Cju4Q5ND97wzWltji6xPXOGJ9DX+MuHSSWyyGgT9iyzcWsaxj1P2gIhN ZoZAmieb/bp+Dh/tSZAo0g1gI8TJ7Cp2gxhDUWfG1cXNsAamFT96b+DTHpo8oG9Y 4YsXyw== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 48jgvewyyw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Aug 2025 14:13:21 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0A47540053; Mon, 18 Aug 2025 14:10:12 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id CD98B6D4186; Mon, 18 Aug 2025 14:08:47 +0200 (CEST) Received: from [10.48.87.121] (10.48.87.121) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Aug 2025 14:08:43 +0200 Message-ID: <20437dbf-9d45-4a51-815f-ad1d1d15346e@foss.st.com> Date: Mon, 18 Aug 2025 14:08:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 058/114] clk: stm32: stm32-core: convert from round_rate() to determine_rate() 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 , , 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: , , , , , , , , , , , , , , , , , , References: <20250811-clk-for-stephen-round-rate-v1-0-b3bf97b038dc@redhat.com> <20250811-clk-for-stephen-round-rate-v1-58-b3bf97b038dc@redhat.com> Content-Language: en-US From: Gabriel FERNANDEZ In-Reply-To: <20250811-clk-for-stephen-round-rate-v1-58-b3bf97b038dc@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.87.121] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-18_05,2025-08-14_01,2025-03-28_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250818_051434_385832_7AF14858 X-CRM114-Status: GOOD ( 17.43 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 8/11/25 17:18, Brian Masney via B4 Relay wrote: > 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 Reviewed-by: Gabriel Fernandez > --- > drivers/clk/stm32/clk-stm32-core.c | 28 ++++++++++++++++++---------- > 1 file changed, 18 insertions(+), 10 deletions(-) > > diff --git a/drivers/clk/stm32/clk-stm32-core.c b/drivers/clk/stm32/clk-stm32-core.c > index 933e3cde0795386c3e5e6902aa0989cf3dffc01e..72825b9c36a4d3b8ba3f7615b9026c09ffaf88d1 100644 > --- a/drivers/clk/stm32/clk-stm32-core.c > +++ b/drivers/clk/stm32/clk-stm32-core.c > @@ -351,14 +351,14 @@ static int clk_stm32_divider_set_rate(struct clk_hw *hw, unsigned long rate, > return ret; > } > > -static long clk_stm32_divider_round_rate(struct clk_hw *hw, unsigned long rate, > - unsigned long *prate) > +static int clk_stm32_divider_determine_rate(struct clk_hw *hw, > + struct clk_rate_request *req) > { > struct clk_stm32_div *div = to_clk_stm32_divider(hw); > const struct stm32_div_cfg *divider; > > if (div->div_id == NO_STM32_DIV) > - return rate; > + return 0; > > divider = &div->clock_data->dividers[div->div_id]; > > @@ -369,14 +369,22 @@ static long clk_stm32_divider_round_rate(struct clk_hw *hw, unsigned long rate, > val = readl(div->base + divider->offset) >> divider->shift; > val &= clk_div_mask(divider->width); > > - return divider_ro_round_rate(hw, rate, prate, divider->table, > - divider->width, divider->flags, > - val); > + req->rate = divider_ro_round_rate(hw, req->rate, > + &req->best_parent_rate, > + divider->table, > + divider->width, > + divider->flags, val); > + > + return 0; > } > > - return divider_round_rate_parent(hw, clk_hw_get_parent(hw), > - rate, prate, divider->table, > - divider->width, divider->flags); > + req->rate = divider_round_rate_parent(hw, clk_hw_get_parent(hw), > + req->rate, > + &req->best_parent_rate, > + divider->table, > + divider->width, divider->flags); > + > + return 0; > } > > static unsigned long clk_stm32_divider_recalc_rate(struct clk_hw *hw, > @@ -392,7 +400,7 @@ static unsigned long clk_stm32_divider_recalc_rate(struct clk_hw *hw, > > const struct clk_ops clk_stm32_divider_ops = { > .recalc_rate = clk_stm32_divider_recalc_rate, > - .round_rate = clk_stm32_divider_round_rate, > + .determine_rate = clk_stm32_divider_determine_rate, > .set_rate = clk_stm32_divider_set_rate, > }; > >