From: Abel Vesa <abel.vesa@nxp.com>
To: Aisheng Dong <aisheng.dong@nxp.com>,
Shawn Guo <shawnguo@kernel.org>,
Leonard Crestez <leonard.crestez@nxp.com>,
Stephen Boyd <sboyd@kernel.org>,
Sascha Hauer <kernel@pengutronix.de>,
Jacky Bai <ping.bai@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>, dl-linux-imx <linux-imx@nxp.com>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Abel Vesa <abel.vesa@nxp.com>
Subject: [PATCH v2 05/11] clk: imx: pllv2: Switch to clk_hw based API
Date: Fri, 22 Nov 2019 10:48:14 +0000 [thread overview]
Message-ID: <1574419679-3813-6-git-send-email-abel.vesa@nxp.com> (raw)
In-Reply-To: <1574419679-3813-1-git-send-email-abel.vesa@nxp.com>
Switch the imx_clk_pllv2 register function to clk_hw based API, rename
accordingly and add a macro for clk based legacy. This allows us to
move closer to a clear split between consumer and provider clk APIs.
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
drivers/clk/imx/clk-pllv2.c | 14 +++++++++-----
drivers/clk/imx/clk.h | 5 ++++-
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/imx/clk-pllv2.c b/drivers/clk/imx/clk-pllv2.c
index eeba3cb..ff17f06 100644
--- a/drivers/clk/imx/clk-pllv2.c
+++ b/drivers/clk/imx/clk-pllv2.c
@@ -239,12 +239,13 @@ static const struct clk_ops clk_pllv2_ops = {
.set_rate = clk_pllv2_set_rate,
};
-struct clk *imx_clk_pllv2(const char *name, const char *parent,
+struct clk_hw *imx_clk_hw_pllv2(const char *name, const char *parent,
void __iomem *base)
{
struct clk_pllv2 *pll;
- struct clk *clk;
+ struct clk_hw *hw;
struct clk_init_data init;
+ int ret;
pll = kzalloc(sizeof(*pll), GFP_KERNEL);
if (!pll)
@@ -259,10 +260,13 @@ struct clk *imx_clk_pllv2(const char *name, const char *parent,
init.num_parents = 1;
pll->hw.init = &init;
+ hw = &pll->hw;
- clk = clk_register(NULL, &pll->hw);
- if (IS_ERR(clk))
+ ret = clk_hw_register(NULL, hw);
+ if (ret) {
kfree(pll);
+ return ERR_PTR(ret);
+ }
- return clk;
+ return hw;
}
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index bd6a592..331f5ab 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -112,13 +112,16 @@ extern struct imx_pll14xx_clk imx_1443x_pll;
#define imx_clk_pllv1(type, name, parent, base) \
to_clk(imx_clk_hw_pllv1(type, name, parent, base))
+#define imx_clk_pllv2(name, parent, base) \
+ to_clk(imx_clk_hw_pllv2(name, parent, base))
+
struct clk *imx_clk_pll14xx(const char *name, const char *parent_name,
void __iomem *base, const struct imx_pll14xx_clk *pll_clk);
struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name,
const char *parent, void __iomem *base);
-struct clk *imx_clk_pllv2(const char *name, const char *parent,
+struct clk_hw *imx_clk_hw_pllv2(const char *name, const char *parent,
void __iomem *base);
struct clk *imx_clk_frac_pll(const char *name, const char *parent_name,
--
2.7.4
next prev parent reply other threads:[~2019-11-22 11:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 10:48 [PATCH v2 00/11] clk: imx: Trivial cleanups for clk_hw based API Abel Vesa
2019-11-22 10:48 ` [PATCH v2 01/11] clk: imx: Add correct failure handling for clk based helpers Abel Vesa
2019-11-22 21:48 ` Leonard Crestez
2019-11-22 10:48 ` [PATCH v2 02/11] clk: imx: Rename the SCCG to SSCG Abel Vesa
2019-11-22 21:50 ` Leonard Crestez
2019-11-22 10:48 ` [PATCH v2 04/11] clk: imx: pllv1: Switch to clk_hw based API Abel Vesa
2019-11-22 10:48 ` [PATCH v2 03/11] clk: imx: Replace all the clk based helpers with macros Abel Vesa
2019-11-22 10:48 ` Abel Vesa [this message]
2019-11-22 10:48 ` [PATCH v2 06/11] clk: imx: imx7ulp composite: Rename to show is clk_hw based Abel Vesa
2019-11-22 10:48 ` [PATCH v2 07/11] clk: imx: Rename sccg and frac pll register to suggest clk_hw Abel Vesa
2019-11-22 10:48 ` [PATCH v2 08/11] clk: imx: Rename the imx_clk_pllv4 to imply it's clk_hw based Abel Vesa
2019-11-22 10:48 ` [PATCH v2 09/11] clk: imx: Rename the imx_clk_pfdv2 " Abel Vesa
2019-11-22 10:48 ` [PATCH v2 10/11] clk: imx: Rename the imx_clk_divider_gate " Abel Vesa
2019-11-22 10:48 ` [PATCH v2 11/11] clk: imx7up: Rename the clks to hws Abel Vesa
2019-12-09 3:39 ` [PATCH v2 00/11] clk: imx: Trivial cleanups for clk_hw based API Shawn Guo
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=1574419679-3813-6-git-send-email-abel.vesa@nxp.com \
--to=abel.vesa@nxp.com \
--cc=aisheng.dong@nxp.com \
--cc=kernel@pengutronix.de \
--cc=leonard.crestez@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=ping.bai@nxp.com \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.org \
/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).