From aac2c7167921322237c0d64582376ca01319ab63 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Tue, 28 Nov 2023 16:59:23 +0100 Subject: [PATCH] drivers: clk: print clock tree with debug trace level Change clk_print_tree() to print the clock tree with debug trace level instead of info trace level. Add a test on TRACE_LEVEL >= TRACE_DEBUG in clk_print_tree() to ensures no unless code is embedded when the trace level is too low. Reviewed-by: Jens Wiklander Signed-off-by: Etienne Carriere --- core/drivers/clk/clk.c | 9 +++++---- core/include/drivers/clk.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/drivers/clk/clk.c b/core/drivers/clk/clk.c index 333d91f68fc..8f5a6a5d28b 100644 --- a/core/drivers/clk/clk.c +++ b/core/drivers/clk/clk.c @@ -436,7 +436,7 @@ static void __maybe_unused print_clk(struct clk *clk, int indent) if (!msg) snprintf(msg_end - 4, 4, "..."); - IMSG("%s", msg_buf); + DMSG("%s", msg_buf); } static void print_tree(void) @@ -448,7 +448,7 @@ static void print_tree(void) #ifdef CFG_DRIVERS_CLK_PRINT_TREE if (SLIST_EMPTY(&clock_list)) { - IMSG("-- No registered clock"); + DMSG("-- No registered clock"); return; } #endif @@ -481,8 +481,9 @@ static void print_tree(void) void clk_print_tree(void) { - if (IS_ENABLED(CFG_DRIVERS_CLK_PRINT_TREE)) { - IMSG("Clock tree summary (informative):"); + if (IS_ENABLED(CFG_DRIVERS_CLK_PRINT_TREE) && + TRACE_LEVEL >= TRACE_DEBUG) { + DMSG("Clock tree summary (informative):"); print_tree(); } } diff --git a/core/include/drivers/clk.h b/core/include/drivers/clk.h index 340a797902a..20b7d54052a 100644 --- a/core/include/drivers/clk.h +++ b/core/include/drivers/clk.h @@ -199,7 +199,7 @@ TEE_Result clk_set_parent(struct clk *clk, struct clk *parent); TEE_Result clk_get_rates_array(struct clk *clk, size_t start_index, unsigned long *rates, size_t *nb_elts); -/* Print current clock tree summary on output console (info trace level) */ +/* Print current clock tree summary to output console with debug trace level */ #ifdef CFG_DRIVERS_CLK void clk_print_tree(void); #else