summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-05-14 04:39:31 +0300
committerTom Rini <trini@konsulko.com>2021-07-16 01:42:40 +0300
commit92f1e9a4b31c0bf0f4f61ab823a6a88657323646 (patch)
treef9a82b53c030349b558fbb1319c27a0988c9bf91 /drivers/clk
parent9a72bea6cbb14f196acc6422d6f5b1eefb590a61 (diff)
downloadu-boot-92f1e9a4b31c0bf0f4f61ab823a6a88657323646.tar.xz
clk: Detect failure to set defaults
When the default clocks cannot be set, the clock is silently probed and the error is ignored. This is incorrect, since having the clocks at the correct speed may be important for operation of the system. Fix it by checking the return code. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk-uclass.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index f049e36380..cea38a4c6e 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -847,13 +847,17 @@ void devm_clk_put(struct udevice *dev, struct clk *clk)
int clk_uclass_post_probe(struct udevice *dev)
{
+ int ret;
+
/*
* when a clock provider is probed. Call clk_set_defaults()
* also after the device is probed. This takes care of cases
* where the DT is used to setup default parents and rates
* using assigned-clocks
*/
- clk_set_defaults(dev, CLK_DEFAULTS_POST);
+ ret = clk_set_defaults(dev, CLK_DEFAULTS_POST);
+ if (ret)
+ return log_ret(ret);
return 0;
}