[PATCH 4/4] commands: of_overlay: Allow to register clocks from overlay

Sascha Hauer s.hauer at pengutronix.de
Wed Mar 22 01:32:45 PDT 2023


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 at 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




More information about the barebox mailing list