diff options
author | Peng Fan <peng.fan@nxp.com> | 2019-07-31 07:01:26 +0000 |
---|---|---|
committer | Lukasz Majewski <lukma@denx.de> | 2019-07-31 09:20:51 +0200 |
commit | 5b27ff89866e36764c5e3e997bf505956ce49527 (patch) | |
tree | 590d63b791a76a2847409cecd3ff930626f6b4de /drivers/clk | |
parent | 2457612d6d374bd67d3317f11cf24fc0bba02274 (diff) | |
download | u-boot-5b27ff89866e36764c5e3e997bf505956ce49527.tar.gz u-boot-5b27ff89866e36764c5e3e997bf505956ce49527.tar.bz2 u-boot-5b27ff89866e36764c5e3e997bf505956ce49527.zip |
clk: use clk_dev_binded
Preparing to support composite clk.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk-divider.c | 4 | ||||
-rw-r--r-- | drivers/clk/clk-mux.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index 6921c76a48..2ed9ed6ab8 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c @@ -69,8 +69,8 @@ unsigned long divider_recalc_rate(struct clk *hw, unsigned long parent_rate, 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; diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index 3c075aa09e..81d1e7ebee 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -35,7 +35,8 @@ int clk_mux_val_to_index(struct clk *clk, u32 *table, unsigned int flags, unsigned int val) { - struct clk_mux *mux = to_clk_mux(clk); + struct clk_mux *mux = to_clk_mux(clk_dev_binded(clk) ? + dev_get_clk_ptr(clk->dev) : clk); int num_parents = mux->num_parents; if (table) { @@ -61,7 +62,8 @@ int clk_mux_val_to_index(struct clk *clk, u32 *table, unsigned int flags, static u8 clk_mux_get_parent(struct clk *clk) { - struct clk_mux *mux = to_clk_mux(clk); + struct clk_mux *mux = to_clk_mux(clk_dev_binded(clk) ? + dev_get_clk_ptr(clk->dev) : clk); u32 val; #if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF) |