diff options
author | Dario Binacchi <dariobin@libero.it> | 2020-10-14 23:42:17 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-10-22 11:26:14 -0400 |
commit | fa181d1a95a2851873f586139b7ca3c35c551498 (patch) | |
tree | 11149ed982bd35591c66dc58ea431f3c10e9ac71 /drivers/clk | |
parent | 69509fb0a592b8bd9b3d50d58493b22b6359f19a (diff) | |
download | u-boot-fa181d1a95a2851873f586139b7ca3c35c551498.zip u-boot-fa181d1a95a2851873f586139b7ca3c35c551498.tar.gz u-boot-fa181d1a95a2851873f586139b7ca3c35c551498.tar.bz2 |
clk: ccf: replace the get_rate helper
The 12d152620d commit fixed the get_rate helper because the set_parent
one did not re-parent the clock device to the new parent. The 4d139f3838
commit allows you to remove this workaround by calling the
clk_get_parent_rate routine.
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk-mux.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index 7a5ee7a..f1becd2 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -150,32 +150,8 @@ static int clk_mux_set_parent(struct clk *clk, struct clk *parent) return 0; } -static ulong clk_mux_get_rate(struct clk *clk) -{ - struct clk_mux *mux = to_clk_mux(clk_dev_binded(clk) ? - dev_get_clk_ptr(clk->dev) : clk); - struct udevice *parent; - struct clk *pclk; - int err, index; - - index = clk_mux_get_parent(clk); - if (index >= mux->num_parents) - return -EFAULT; - - err = uclass_get_device_by_name(UCLASS_CLK, mux->parent_names[index], - &parent); - if (err) - return err; - - pclk = dev_get_clk_ptr(parent); - if (!pclk) - return -ENODEV; - - return clk_get_rate(pclk); -} - const struct clk_ops clk_mux_ops = { - .get_rate = clk_mux_get_rate, + .get_rate = clk_generic_get_rate, .set_parent = clk_mux_set_parent, }; |