diff options
author | Tero Kristo <t-kristo@ti.com> | 2017-10-12 10:55:29 +0300 |
---|---|---|
committer | Tero Kristo <t-kristo@ti.com> | 2017-12-01 15:16:49 +0200 |
commit | 729e13bf58e643b9accd2a14c55b555958702fb0 (patch) | |
tree | 9180a78e859a6d126fed1cb69e788a58c4b39dfc /drivers/clk/ti | |
parent | ffb009b24388b896d9ca8b54e39a879302142518 (diff) | |
download | linux-729e13bf58e643b9accd2a14c55b555958702fb0.tar.gz linux-729e13bf58e643b9accd2a14c55b555958702fb0.tar.bz2 linux-729e13bf58e643b9accd2a14c55b555958702fb0.zip |
clk: ti: clkctrl: add support for retrying failed init
In case the clkctrl node contains assigned-clock-* entries, registering
the provider can fail with -EPROBE_DEFER. In this case, add the
provider to the retry_init clock list so it will be cleaned up later.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/ti')
-rw-r--r-- | drivers/clk/ti/clkctrl.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 38dbcc1b7e2c..7d82fff25d5b 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -414,6 +414,12 @@ _ti_clkctrl_setup_subclks(struct omap_clkctrl_provider *provider, } } +static void __init _clkctrl_add_provider(void *data, + struct device_node *np) +{ + of_clk_add_hw_provider(np, _ti_omap4_clkctrl_xlate, data); +} + static void __init _ti_omap4_clkctrl_setup(struct device_node *node) { struct omap_clkctrl_provider *provider; @@ -425,6 +431,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) struct omap_clkctrl_clk *clkctrl_clk; const __be32 *addrp; u32 addr; + int ret; addrp = of_get_address(node, 0, NULL, NULL); addr = (u32)of_translate_address(node, addrp); @@ -519,7 +526,10 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) reg_data++; } - of_clk_add_hw_provider(node, _ti_omap4_clkctrl_xlate, provider); + ret = of_clk_add_hw_provider(node, _ti_omap4_clkctrl_xlate, provider); + if (ret == -EPROBE_DEFER) + ti_clk_retry_init(node, provider, _clkctrl_add_provider); + return; cleanup: |