mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 4/4] commands: of_overlay: Allow to register clocks from overlay
Date: Wed, 22 Mar 2023 09:32:45 +0100	[thread overview]
Message-ID: <20230322083245.251340-5-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20230322083245.251340-1-s.hauer@pengutronix.de>

When clocks are added from an overlay calling of_probe() is enough
for devices handled by regular drivers, but not for clocks declared
with CLK_OF_DECLARE(). Additionally call of_clk_init() to support
these as well.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 commands/of_overlay.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/commands/of_overlay.c b/commands/of_overlay.c
index 37d29b88e5..1bd54a7b10 100644
--- a/commands/of_overlay.c
+++ b/commands/of_overlay.c
@@ -10,6 +10,7 @@
 #include <getopt.h>
 #include <libfile.h>
 #include <of.h>
+#include <linux/clk.h>
 
 static int do_of_overlay(int argc, char *argv[])
 {
@@ -49,8 +50,11 @@ static int do_of_overlay(int argc, char *argv[])
 
 	if (live_tree) {
 		ret = of_overlay_apply_tree(of_get_root_node(), overlay);
-		if (!ret)
-			ret = of_probe();
+		if (ret)
+			goto err;
+
+		of_probe();
+		of_clk_init();
 	} else {
 		ret = of_register_overlay(overlay);
 	}
-- 
2.30.2




  parent reply	other threads:[~2023-03-22  8:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22  8:32 [PATCH 0/4] Allow to probe clks added in overlays Sascha Hauer
2023-03-22  8:32 ` [PATCH 1/4] clk: clk-gpio: Turn into driver Sascha Hauer
2023-03-22  8:32 ` [PATCH 2/4] clk: of: drop arguments from of_clk_init() Sascha Hauer
2023-03-22  8:32 ` [PATCH 3/4] clk: of: make of_clk_init() safe for being called multiple times Sascha Hauer
2023-03-22  8:32 ` Sascha Hauer [this message]
2023-03-22  9:25   ` [PATCH 4/4] commands: of_overlay: Allow to register clocks from overlay Sascha Hauer

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=20230322083245.251340-5-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@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