diff options
author | Tero Kristo | 2021-06-11 11:45:11 +0300 |
---|---|---|
committer | Lokesh Vutla | 2021-06-11 16:34:52 +0530 |
commit | 1e1fab0be59217aff9378e24f94f2340fbe2c3f7 (patch) | |
tree | 326e6c0a3ecfa077699b02f3c91cd1086e32f0e4 /drivers/clk | |
parent | c319572abd95826b958c753ebcd3b83884eb60af (diff) |
clk: fix assigned-clocks to pass with deferring provider
If a clock provider is not ready for assigning default rates/parents
during its probe, it may return -EPROBE_DEFER directly from xlate.
Handle this special case properly by skipping the entry and adjusting the
return value to pass. The defaults will be handled properly in post probe
phase then.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk-uclass.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 451d7da001a..815f7bfe987 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -241,6 +241,15 @@ static int clk_set_default_parents(struct udevice *dev, int stage) ret = clk_get_by_indexed_prop(dev, "assigned-clocks", index, &clk); + /* + * If the clock provider is not ready yet, let it handle + * the re-programming later. + */ + if (ret == -EPROBE_DEFER) { + ret = 0; + continue; + } + if (ret) { debug("%s: could not get assigned clock %d for %s\n", __func__, index, dev_read_name(dev)); @@ -309,6 +318,15 @@ static int clk_set_default_rates(struct udevice *dev, int stage) ret = clk_get_by_indexed_prop(dev, "assigned-clocks", index, &clk); + /* + * If the clock provider is not ready yet, let it handle + * the re-programming later. + */ + if (ret == -EPROBE_DEFER) { + ret = 0; + continue; + } + if (ret) { dev_dbg(dev, "could not get assigned clock %d (err = %d)\n", |