Message ID | 20221113180945.1626061-1-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1781887wru; Sun, 13 Nov 2022 10:12:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf7tvwKAz5T9wjyZx754slpRZsE3hkdHmBngIoey6qsLbWd3KM3qNwcBfBEnDBeIgQGOXYYL X-Received: by 2002:a17:906:6894:b0:79e:1783:7f68 with SMTP id n20-20020a170906689400b0079e17837f68mr8319813ejr.11.1668363144308; Sun, 13 Nov 2022 10:12:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668363144; cv=none; d=google.com; s=arc-20160816; b=m/MmMMxSSETswr6PC0c5R0Pqnly0SnYDEvZg0CuqBDuPbK9Z7KpjDOSpFSSSzXG3Jf GXUdXvR3jRpCfqECbfjTVvMWzzbYLuC+rRzllN7S2/2JdTZHr5ejnvWGCzgUy+y3V2NV JEkvynKm89IFSSZIJVPBVQwA9afYNBbTXAwZLAo9TwJLpuSqgCMhwI7lUi0M/ZHdbxGK ersfN18ALCQRWmOdEges18wuyo/UP/pofk8XUGtiLCzuXNHFyX9JgXU7zIJKwGEn/ehZ g34lZTmOim6XdtmWpFBUhRuvq+FLFGN9GRRms3dYzXG/q1vXf+ghqRD4NZSvF61p1XcQ EUTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4byRwPo02lvkmaR0NL7PCXZ/wh86nqqJqs0NF0iJNN4=; b=hmVn5pTL6yTEavxb+mFaNG0X/fDNKdLrtzkKBHDATalO/53JT0AJFJObh2jeL8Finu gDPahLrNI1+LUOW9MedxVOTF1gw6y7tVsz7yj2pNQb3edhJ/Re5RXnEUFdprYBZTNm21 9YbgyKgR2t00eWENDkDL2+h/eM09IY788JSWDlNZeKHdjdOVoBlx7jTHJrxbjj3QhsMK ldfvO+ICAT4pgYRrMEMlgF7MivleEi29Wgd91syL4O8FpCWeC+SeKC9qz1iCNbWxV10X 2Gs//P06l6aNk9ZlVcy54beN3txNGDscqQDEisegmfU+SlLC8lii6vuaCJkY4UB21Qyc 7PgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Klr8ditt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a508e13000000b00461c12f1f4csi6076656edw.478.2022.11.13.10.12.00; Sun, 13 Nov 2022 10:12:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Klr8ditt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235388AbiKMSJx (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Sun, 13 Nov 2022 13:09:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235214AbiKMSJw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 13 Nov 2022 13:09:52 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6927BDEB for <linux-kernel@vger.kernel.org>; Sun, 13 Nov 2022 10:09:51 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id f7so14286107edc.6 for <linux-kernel@vger.kernel.org>; Sun, 13 Nov 2022 10:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4byRwPo02lvkmaR0NL7PCXZ/wh86nqqJqs0NF0iJNN4=; b=Klr8dittMggHZPqmUvNZDK5ZpTzudeRXL4AUHJzqU43nDT49Nb42aUWtHpvU8hn7ew m7B76kJn2mJMXEq/4/z2R3bf4MhcbKmVMmKdCanyADpkYqwQwS4VoZckP2z36zXJykVI aeRtqs7bLNLq6WSXm7nMqymtnj7RXCZfz5n+k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4byRwPo02lvkmaR0NL7PCXZ/wh86nqqJqs0NF0iJNN4=; b=5lHfl80p+YQcByKu+WAOyfhcYl3QY9b/n2YnWQFCkaB/tm20EwbEhkDBACDD8SCOug oyaYmhqw1P3635Zukrfsl9ubbay/RHuNMLcWEjXLUTsjTY8R3nzR4zNJHVHOw0v5E/44 DZOXwc8BpGLRPZ5sAhFqpIlgifV3wMtpNY3Yw4caVOoc6MYeazo+VbSrhv9bTt/slh9C Moaz991WXSB41WuvdN8Z0feBA8TrB2XEBTs//lbkzyJjPu6Z+68cxAnSS+/otpWSN1U0 7TXlCGIw5+5bCwDYg6xeUCX9+uuc5Y7E8CAUVZg2oaIXNsrW4D8AEU9CfugLQQ+aJw4L SZPA== X-Gm-Message-State: ANoB5pnSJp8cD8MUei8QS5RYoyAV0zE70QROSWbHYuuDHCfsR5E7sO+j t/Pc80ocEc5EXaDHEdh1+5P80txL1Yurnw== X-Received: by 2002:a05:6402:381b:b0:456:d9f9:8f3a with SMTP id es27-20020a056402381b00b00456d9f98f3amr8801725edb.258.1668362989724; Sun, 13 Nov 2022 10:09:49 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-40-103-33.business.telecomitalia.it. [79.40.103.33]) by smtp.gmail.com with ESMTPSA id n23-20020a170906701700b0078db18d7972sm3197502ejj.117.2022.11.13.10.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 10:09:49 -0800 (PST) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: linux-kernel@vger.kernel.org Cc: michael@amarulasolutions.com, Amarula patchwork <linux-amarula@amarulasolutions.com>, Dario Binacchi <dario.binacchi@amarulasolutions.com>, Abel Vesa <abelvesa@kernel.org>, Fabio Estevam <festevam@gmail.com>, Michael Turquette <mturquette@baylibre.com>, NXP Linux Team <linux-imx@nxp.com>, Pengutronix Kernel Team <kernel@pengutronix.de>, Sascha Hauer <s.hauer@pengutronix.de>, Shawn Guo <shawnguo@kernel.org>, Stephen Boyd <sboyd@kernel.org>, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH] clk: imx: DRY cleanup of imx_obtain_fixed_clock_hw() Date: Sun, 13 Nov 2022 19:09:44 +0100 Message-Id: <20221113180945.1626061-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749405552471383902?= X-GMAIL-MSGID: =?utf-8?q?1749405552471383902?= |
Series |
clk: imx: DRY cleanup of imx_obtain_fixed_clock_hw()
|
|
Commit Message
Dario Binacchi
Nov. 13, 2022, 6:09 p.m. UTC
The imx_obtain_fixed_clock() and imx_obtain_fixed_clock_hw() functions
behave pretty similarly, DRY and call one from another.
No functional changes intended.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
drivers/clk/imx/clk.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Comments
On 22-11-13 19:09:44, Dario Binacchi wrote: > The imx_obtain_fixed_clock() and imx_obtain_fixed_clock_hw() functions > behave pretty similarly, DRY and call one from another. > > No functional changes intended. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > drivers/clk/imx/clk.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c > index 5582f18dd632..573b1a6ca1dc 100644 > --- a/drivers/clk/imx/clk.c > +++ b/drivers/clk/imx/clk.c > @@ -104,9 +104,7 @@ struct clk_hw *imx_obtain_fixed_clock_hw( > { > struct clk *clk; > > - clk = imx_obtain_fixed_clock_from_dt(name); > - if (IS_ERR(clk)) > - clk = imx_clk_fixed(name, rate); > + clk = imx_obtain_fixed_clock(name, rate); NACK here. You're switching to a non "clk_hw" based variant that should/would be removed in the near future. In the future, we want the clock providers to not used "clk" based APIs. Rule is, AFAIR, to use "clk" based APIs in clock consumer drivers only, while using "clk_hw" based APIs in clock provider drivers only. Right now, only the imx5 and vf610 clock provider drivers still use the 'clk' based API. Once those are switched to 'clk_hw' based, all the 'clk' i.MX specific APIs will be removed for good. > return __clk_get_hw(clk); > } > > -- > 2.32.0 >
Hi Abel, On Mon, Nov 21, 2022 at 8:19 PM Abel Vesa <abel.vesa@linaro.org> wrote: > > On 22-11-13 19:09:44, Dario Binacchi wrote: > > The imx_obtain_fixed_clock() and imx_obtain_fixed_clock_hw() functions > > behave pretty similarly, DRY and call one from another. > > > > No functional changes intended. > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > > --- > > > > drivers/clk/imx/clk.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c > > index 5582f18dd632..573b1a6ca1dc 100644 > > --- a/drivers/clk/imx/clk.c > > +++ b/drivers/clk/imx/clk.c > > @@ -104,9 +104,7 @@ struct clk_hw *imx_obtain_fixed_clock_hw( > > { > > struct clk *clk; > > > > - clk = imx_obtain_fixed_clock_from_dt(name); > > - if (IS_ERR(clk)) > > - clk = imx_clk_fixed(name, rate); > > + clk = imx_obtain_fixed_clock(name, rate); > > NACK here. You're switching to a non "clk_hw" based variant that > should/would be removed in the near future. > > In the future, we want the clock providers to not used "clk" based APIs. > > Rule is, AFAIR, to use "clk" based APIs in clock consumer drivers only, > while using "clk_hw" based APIs in clock provider drivers only. > > Right now, only the imx5 and vf610 clock provider drivers still use the > 'clk' based API. Once those are switched to 'clk_hw' based, all the 'clk' > i.MX specific APIs will be removed for good. Thanks for your explanations. Best regards, Dario > > > return __clk_get_hw(clk); > > } > > > > -- > > 2.32.0 > >
diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index 5582f18dd632..573b1a6ca1dc 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -104,9 +104,7 @@ struct clk_hw *imx_obtain_fixed_clock_hw( { struct clk *clk; - clk = imx_obtain_fixed_clock_from_dt(name); - if (IS_ERR(clk)) - clk = imx_clk_fixed(name, rate); + clk = imx_obtain_fixed_clock(name, rate); return __clk_get_hw(clk); }