All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abel Vesa <abel.vesa@nxp.com>
To: Stephen Boyd <sboyd@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	Lucas Stach <l.stach@pengutronix.de>,
	Sascha Hauer <kernel@pengutronix.de>
Cc: "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: [RFC 09/19] clk: imx: clk-pfd: Switch to clk_hw based API
Date: Fri, 22 Mar 2019 15:37:09 +0000	[thread overview]
Message-ID: <1553269010-15591-10-git-send-email-abel.vesa@nxp.com> (raw)
In-Reply-To: <1553269010-15591-1-git-send-email-abel.vesa@nxp.com>

Switch the imx_clk_pfd function to clk_hw based API,
rename accordingly and add a macro for clk based legacy.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
---
 drivers/clk/imx/clk-pfd.c | 14 +++++++++-----
 drivers/clk/imx/clk.h     |  5 ++++-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/imx/clk-pfd.c b/drivers/clk/imx/clk-pfd.c
index 04a3e78..3b43d29 100644
--- a/drivers/clk/imx/clk-pfd.c
+++ b/drivers/clk/imx/clk-pfd.c
@@ -127,12 +127,13 @@ static const struct clk_ops clk_pfd_ops = {
 	.is_enabled     = clk_pfd_is_enabled,
 };
 
-struct clk *imx_clk_pfd(const char *name, const char *parent_name,
+struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name,
 			void __iomem *reg, u8 idx)
 {
 	struct clk_pfd *pfd;
-	struct clk *clk;
+	struct clk_hw *hw;
 	struct clk_init_data init;
+	int ret;
 
 	pfd = kzalloc(sizeof(*pfd), GFP_KERNEL);
 	if (!pfd)
@@ -148,10 +149,13 @@ struct clk *imx_clk_pfd(const char *name, const char *parent_name,
 	init.num_parents = 1;
 
 	pfd->hw.init = &init;
+	hw = &pfd->hw;
 
-	clk = clk_register(NULL, &pfd->hw);
-	if (IS_ERR(clk))
+	ret = clk_hw_register(NULL, hw);
+	if (ret) {
 		kfree(pfd);
+		return ERR_PTR(ret);
+	}
 
-	return clk;
+	return hw;
 }
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index 89f1276..14c410e 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -66,6 +66,9 @@ struct imx_pll14xx_clk {
 #define imx_clk_pllv3(type, name, parent_name, base, div_mask) \
 	imx_clk_hw_pllv3(type, name, parent_name, base, div_mask)->clk
 
+#define imx_clk_pfd(name, parent_name, reg, idx) \
+	imx_clk_hw_pfd(name, parent_name, reg, idx)->clk
+
 struct clk *imx_clk_pll14xx(const char *name, const char *parent_name,
 		 void __iomem *base, const struct imx_pll14xx_clk *pll_clk);
 
@@ -121,7 +124,7 @@ struct clk_hw *imx_obtain_fixed_clk_hw(struct device_node *np,
 struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
 	 void __iomem *reg, u8 shift, u32 exclusive_mask);
 
-struct clk *imx_clk_pfd(const char *name, const char *parent_name,
+struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name,
 		void __iomem *reg, u8 idx);
 
 struct clk_hw *imx_clk_pfdv2(const char *name, const char *parent_name,
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: Abel Vesa <abel.vesa@nxp.com>
To: Stephen Boyd <sboyd@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	Lucas Stach <l.stach@pengutronix.de>,
	Sascha Hauer <kernel@pengutronix.de>
Cc: Abel Vesa <abel.vesa@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>
Subject: [RFC 09/19] clk: imx: clk-pfd: Switch to clk_hw based API
Date: Fri, 22 Mar 2019 15:37:09 +0000	[thread overview]
Message-ID: <1553269010-15591-10-git-send-email-abel.vesa@nxp.com> (raw)
In-Reply-To: <1553269010-15591-1-git-send-email-abel.vesa@nxp.com>

Switch the imx_clk_pfd function to clk_hw based API,
rename accordingly and add a macro for clk based legacy.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
---
 drivers/clk/imx/clk-pfd.c | 14 +++++++++-----
 drivers/clk/imx/clk.h     |  5 ++++-
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/imx/clk-pfd.c b/drivers/clk/imx/clk-pfd.c
index 04a3e78..3b43d29 100644
--- a/drivers/clk/imx/clk-pfd.c
+++ b/drivers/clk/imx/clk-pfd.c
@@ -127,12 +127,13 @@ static const struct clk_ops clk_pfd_ops = {
 	.is_enabled     = clk_pfd_is_enabled,
 };
 
-struct clk *imx_clk_pfd(const char *name, const char *parent_name,
+struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name,
 			void __iomem *reg, u8 idx)
 {
 	struct clk_pfd *pfd;
-	struct clk *clk;
+	struct clk_hw *hw;
 	struct clk_init_data init;
+	int ret;
 
 	pfd = kzalloc(sizeof(*pfd), GFP_KERNEL);
 	if (!pfd)
@@ -148,10 +149,13 @@ struct clk *imx_clk_pfd(const char *name, const char *parent_name,
 	init.num_parents = 1;
 
 	pfd->hw.init = &init;
+	hw = &pfd->hw;
 
-	clk = clk_register(NULL, &pfd->hw);
-	if (IS_ERR(clk))
+	ret = clk_hw_register(NULL, hw);
+	if (ret) {
 		kfree(pfd);
+		return ERR_PTR(ret);
+	}
 
-	return clk;
+	return hw;
 }
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index 89f1276..14c410e 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -66,6 +66,9 @@ struct imx_pll14xx_clk {
 #define imx_clk_pllv3(type, name, parent_name, base, div_mask) \
 	imx_clk_hw_pllv3(type, name, parent_name, base, div_mask)->clk
 
+#define imx_clk_pfd(name, parent_name, reg, idx) \
+	imx_clk_hw_pfd(name, parent_name, reg, idx)->clk
+
 struct clk *imx_clk_pll14xx(const char *name, const char *parent_name,
 		 void __iomem *base, const struct imx_pll14xx_clk *pll_clk);
 
@@ -121,7 +124,7 @@ struct clk_hw *imx_obtain_fixed_clk_hw(struct device_node *np,
 struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
 	 void __iomem *reg, u8 shift, u32 exclusive_mask);
 
-struct clk *imx_clk_pfd(const char *name, const char *parent_name,
+struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name,
 		void __iomem *reg, u8 idx);
 
 struct clk_hw *imx_clk_pfdv2(const char *name, const char *parent_name,
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-03-22 15:37 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 15:37 [RFC 00/19] clk: imx: Switch the imx6 and imx7 to clk_hw based API Abel Vesa
2019-03-22 15:37 ` Abel Vesa
2019-03-22 15:37 ` [RFC 01/19] clk: imx: Remove unused imx_get_clk_hw_fixed Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 02/19] clk: imx: Add imx_obtain_fixed_clock clk_hw based variant Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 03/19] clk: imx6sx: Do not reparent to unregistered IMX6SX_CLK_AXI Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 04/19] clk: imx6q: Do not reparent uninitialized IMX6QDL_CLK_PERIPH2 clock Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 05/19] clk: imx: clk-busy: Switch to clk_hw based API Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-23  6:59   ` Daniel Baluta
2019-03-23  6:59     ` Daniel Baluta
2019-03-22 15:37 ` [RFC 06/19] clk: imx: clk-cpu: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 07/19] clk: imx: clk-gate2: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 08/19] clk: imx: clk-pllv3: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` Abel Vesa [this message]
2019-03-22 15:37   ` [RFC 09/19] clk: imx: clk-pfd: " Abel Vesa
2019-03-22 15:37 ` [RFC 10/19] clk: imx: clk-gate-exclusive: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 11/19] clk: imx: clk-fixup-div: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 12/19] clk: imx: clk-fixup-mux: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 13/19] clk: imx: Switch wrappers " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 14/19] clk: imx6q: Switch " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 15/19] clk: imx6sl: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 16/19] clk: imx6sx: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 17/19] clk: imx6ul: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 15:37 ` [RFC 18/19] clk: imx7d: " Abel Vesa
2019-03-22 15:37 ` [RFC 19/19] clk: imx6sll: " Abel Vesa
2019-03-22 15:37   ` Abel Vesa
2019-03-22 16:24 ` [RFC 00/19] clk: imx: Switch the imx6 and imx7 " Fabio Estevam
2019-03-22 16:24   ` Fabio Estevam
2019-04-10 22:00   ` Stephen Boyd
2019-04-10 22:00     ` Stephen Boyd
2019-04-23 21:49     ` Stephen Boyd
2019-04-23 21:49       ` Stephen Boyd
2019-04-24  7:13       ` [EXT] " Abel Vesa
2019-04-24  7:13         ` Abel Vesa
2019-04-25 15:53         ` Stephen Boyd
2019-04-25 15:53           ` Stephen Boyd
2019-04-27 20:02           ` Abel Vesa
2019-04-27 20:02             ` Abel Vesa

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=1553269010-15591-10-git-send-email-abel.vesa@nxp.com \
    --to=abel.vesa@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.