git: 39b33f2632ef - main - clk: Do not print errors when testing a frequency

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Fri, 20 Nov 2026 13:55:48 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=39b33f2632ef3b222f544942b73c97f643e17d1d

commit 39b33f2632ef3b222f544942b73c97f643e17d1d
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2026-10-21 10:13:51 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2026-11-20 13:55:21 +0000

    clk: Do not print errors when testing a frequency
    
    clk_set_freq() with CLK_SET_DRYRUN is used to check if a clock can
    provide a frequency, for example when a mux looks for a suitable parent.
    Several candidates are expected to fail, so only report an error for
    real requests, or when bootverbose is set.
    
    Differential Revision:  https://reviews.freebsd.org/D61020
---
 sys/dev/clk/clk.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sys/dev/clk/clk.c b/sys/dev/clk/clk.c
index e2073dfe7f99..6edda7a019a6 100644
--- a/sys/dev/clk/clk.c
+++ b/sys/dev/clk/clk.c
@@ -1013,8 +1013,9 @@ _clknode_set_freq(struct clknode *clknode, uint64_t *freq, int flags,
 	/* Set frequency for this clock. */
 	rv = CLKNODE_SET_FREQ(clknode, parent_freq, freq, flags, &done);
 	if (rv != 0) {
-		printf("Cannot set frequency for clk: %s, error: %d\n",
-		    clknode->name, rv);
+		if ((flags & CLK_SET_DRYRUN) == 0 || bootverbose)
+			printf("Cannot set frequency for clk: %s, error: %d\n",
+			    clknode->name, rv);
 		if ((flags & CLK_SET_DRYRUN) == 0)
 			clknode_refresh_cache(clknode, parent_freq);
 		return (rv);
@@ -1040,8 +1041,9 @@ _clknode_set_freq(struct clknode *clknode, uint64_t *freq, int flags,
 		    enablecnt);
 	} else {
 		/* End of chain without action. */
-		printf("Cannot set frequency for clk: %s, end of chain\n",
-		    clknode->name);
+		if ((flags & CLK_SET_DRYRUN) == 0 || bootverbose)
+			printf("Cannot set frequency for clk: %s, end of chain\n",
+			    clknode->name);
 		rv = ENXIO;
 	}