aboutsummaryrefslogtreecommitdiff
path: root/drivers/clk/clk_fixed_rate.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/clk_fixed_rate.c')
-rw-r--r--drivers/clk/clk_fixed_rate.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/clk/clk_fixed_rate.c b/drivers/clk/clk_fixed_rate.c
index d8d9f86c864..1fdf8c4e540 100644
--- a/drivers/clk/clk_fixed_rate.c
+++ b/drivers/clk/clk_fixed_rate.c
@@ -8,6 +8,7 @@
#include <dm.h>
struct clk_fixed_rate {
+ struct clk clk;
unsigned long fixed_rate;
};
@@ -15,9 +16,6 @@ struct clk_fixed_rate {
static ulong clk_fixed_rate_get_rate(struct clk *clk)
{
- if (clk->id != 0)
- return -EINVAL;
-
return to_clk_fixed_rate(clk->dev)->fixed_rate;
}
@@ -27,10 +25,14 @@ const struct clk_ops clk_fixed_rate_ops = {
static int clk_fixed_rate_ofdata_to_platdata(struct udevice *dev)
{
+ struct clk *clk = &to_clk_fixed_rate(dev)->clk;
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
to_clk_fixed_rate(dev)->fixed_rate =
dev_read_u32_default(dev, "clock-frequency", 0);
#endif
+ /* Make fixed rate clock accessible from higher level struct clk */
+ dev->uclass_priv = clk;
+ clk->dev = dev;
return 0;
}