linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sebastian.hesselbarth@gmail.com (Sebastian Hesselbarth)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] clk: mvebu: dove: maintain clock init order
Date: Sat, 25 Jan 2014 19:19:09 +0100	[thread overview]
Message-ID: <1390673950-4521-4-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1390673950-4521-1-git-send-email-sebastian.hesselbarth@gmail.com>

Init order of CLK_OF_DECLARE'd drivers depends on compile order.
Unfortunately, clk_of_init does not allow drivers to return errors,
e.g. -EPROBE_DEFER if parent clocks have not been registered, yet.

To avoid init order woes for MVEBU clock drivers, we take care of
proper init order ourselves. This patch joins core-clk and gating-clk
init to maintain proper init order.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Gregory Clement <gregory.clement@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
---
 drivers/clk/mvebu/dove.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/mvebu/dove.c b/drivers/clk/mvebu/dove.c
index 38aee1e3f242..b8c2424ac926 100644
--- a/drivers/clk/mvebu/dove.c
+++ b/drivers/clk/mvebu/dove.c
@@ -154,12 +154,6 @@ static const struct coreclk_soc_desc dove_coreclks = {
 	.num_ratios = ARRAY_SIZE(dove_coreclk_ratios),
 };
 
-static void __init dove_coreclk_init(struct device_node *np)
-{
-	mvebu_coreclk_setup(np, &dove_coreclks);
-}
-CLK_OF_DECLARE(dove_core_clk, "marvell,dove-core-clock", dove_coreclk_init);
-
 /*
  * Clock Gating Control
  */
@@ -186,9 +180,14 @@ static const struct clk_gating_soc_desc dove_gating_desc[] __initconst = {
 	{ }
 };
 
-static void __init dove_clk_gating_init(struct device_node *np)
+static void __init dove_clk_init(struct device_node *np)
 {
-	mvebu_clk_gating_setup(np, dove_gating_desc);
+	struct device_node *cgnp =
+		of_find_compatible_node(NULL, NULL, "marvell,dove-gating-clock");
+
+	mvebu_coreclk_setup(np, &dove_coreclks);
+
+	if (cgnp)
+		mvebu_clk_gating_setup(cgnp, dove_gating_desc);
 }
-CLK_OF_DECLARE(dove_clk_gating, "marvell,dove-gating-clock",
-	       dove_clk_gating_init);
+CLK_OF_DECLARE(dove_clk, "marvell,dove-core-clock", dove_clk_init);
-- 
1.8.5.2

  parent reply	other threads:[~2014-01-25 18:19 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-25 18:19 [PATCH 0/4] clk: mvebu: fix clk init order Sebastian Hesselbarth
2014-01-25 18:19 ` [PATCH 1/4] clk: mvebu: armada-370: maintain clock " Sebastian Hesselbarth
2014-01-25 18:19 ` [PATCH 2/4] clk: mvebu: armada-xp: " Sebastian Hesselbarth
2014-01-25 18:19 ` Sebastian Hesselbarth [this message]
2014-01-25 18:19 ` [PATCH 4/4] clk: mvebu: kirkwood: " Sebastian Hesselbarth
2014-01-25 21:32 ` [PATCH 0/4] clk: mvebu: fix clk " Emilio López
2014-01-25 21:44   ` Sebastian Hesselbarth
2014-01-25 22:11     ` Emilio López
2014-01-26  0:25       ` Ezequiel Garcia
2014-01-27 14:39 ` Thomas Petazzoni
2014-01-27 18:21   ` Sebastian Hesselbarth
2014-01-27 18:28     ` Jason Cooper
2014-01-30 10:24 ` Gregory CLEMENT
2014-01-30 10:31   ` Sebastian Hesselbarth
2014-02-03 23:16     ` Willy Tarreau
2014-02-03 23:36       ` Sebastian Hesselbarth
2014-02-04 14:58         ` Gregory CLEMENT
2014-02-04 20:07           ` Thomas Petazzoni
2014-02-05 14:08 ` Mike Turquette
2014-02-05 17:43   ` Jason Cooper
2014-02-05 18:34 ` Jason Cooper
2014-02-06 17:08   ` Ezequiel Garcia
2014-02-06 18:08     ` Jason Cooper
2014-02-17 14:13   ` Ezequiel Garcia
2014-02-17 14:25     ` Gregory CLEMENT
2014-02-17 14:42       ` Emilio López
2014-02-17 15:04         ` Gregory CLEMENT
2014-02-17 15:31           ` Emilio López
2014-02-17 15:21       ` Ezequiel Garcia
2014-02-17 15:28         ` Gregory CLEMENT
2014-02-17 15:44           ` Ezequiel Garcia
2014-02-17 15:59             ` Gregory CLEMENT
2014-02-17 18:19               ` Ezequiel Garcia
2014-02-18  9:47                 ` Gregory CLEMENT
2014-02-19 16:28                   ` Ezequiel Garcia
2014-02-19 20:24                   ` Emilio López

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=1390673950-4521-4-git-send-email-sebastian.hesselbarth@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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).