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>
This commit is contained in:

committed by
Mike Turquette

parent
86bcfa2e87
commit
a34cd4666f
@@ -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);
|
||||
|
Reference in New Issue
Block a user