summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clkdev.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2013-11-25 19:47:04 +0100
committerMike Turquette <mturquette@linaro.org>2014-02-24 17:14:56 -0800
commita34cd4666f3da84228a82f70c94b8d9b692034ea (patch)
treebdf93ce97c4afa5c1c25de912109b13467c08224 /drivers/clk/clkdev.c
parent86bcfa2e87c42b8af77188e7a939e952199d4da1 (diff)
downloadlinux-a34cd4666f3da84228a82f70c94b8d9b692034ea.tar.bz2
clk: return probe defer when DT clock not yet ready
At probe time, a clock device may not be ready when some other device wants to use it. This patch lets the functions clk_get/devm_clk_get return a probe defer when the clock is defined in the DT but not yet available. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/clkdev.c')
-rw-r--r--drivers/clk/clkdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 48f67218247c..a360b2eca5cb 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -167,6 +167,8 @@ struct clk *clk_get(struct device *dev, const char *con_id)
clk = of_clk_get_by_name(dev->of_node, con_id);
if (!IS_ERR(clk))
return clk;
+ if (PTR_ERR(clk) == -EPROBE_DEFER)
+ return clk;
}
return clk_get_sys(dev_id, con_id);