From 8c12cb3fd80304d4d542d35405aa54ae4a317e9b Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Thu, 8 Apr 2021 22:13:03 -0400 Subject: [PATCH] clk: Warn on failure to assign rate If the user/dev explicitly requests a clock be assigned a certain rate, then we should warn them if we can't do it. This makes it clear if the clock is running at the default rate. Signed-off-by: Sean Anderson --- drivers/clk/clk-uclass.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 4ab3c402ed..53e7be764d 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -309,8 +310,9 @@ static int clk_set_default_rates(struct udevice *dev, int stage) ret = clk_get_by_indexed_prop(dev, "assigned-clocks", index, &clk); if (ret) { - debug("%s: could not get assigned clock %d for %s\n", - __func__, index, dev_read_name(dev)); + dev_dbg(dev, + "could not get assigned clock %d (err = %d)\n", + index, ret); continue; } @@ -332,8 +334,9 @@ static int clk_set_default_rates(struct udevice *dev, int stage) ret = clk_set_rate(c, rates[index]); if (ret < 0) { - debug("%s: failed to set rate on clock index %d (%ld) for %s\n", - __func__, index, clk.id, dev_read_name(dev)); + dev_warn(dev, + "failed to set rate on clock index %d (%ld) (error = %d)\n", + index, clk.id, ret); break; } } -- 2.39.5