clk: use clk_dev_binded
Preparing to support composite clk.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index 6921c76..2ed9ed6 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -69,8 +69,8 @@
static ulong clk_divider_recalc_rate(struct clk *clk)
{
- struct clk_divider *divider =
- to_clk_divider(dev_get_clk_ptr(clk->dev));
+ struct clk_divider *divider = to_clk_divider(clk_dev_binded(clk) ?
+ dev_get_clk_ptr(clk->dev) : clk);
unsigned long parent_rate = clk_get_parent_rate(clk);
unsigned int val;