summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorSekhar Nori <nsekhar@ti.com>2019-07-11 14:30:24 +0530
committerSimon Glass <sjg@chromium.org>2019-07-24 12:54:08 -0700
commite497fabb9186bb2f36b4f3ceda4c69bea8e22233 (patch)
treeb3c3ad3e6da94ba530fbcd6ee38edab4b43b0455 /drivers/clk
parentc026231e15fa634c6865c2f8d2317d973b4cc4b4 (diff)
downloadu-boot-e497fabb9186bb2f36b4f3ceda4c69bea8e22233.tar.gz
u-boot-e497fabb9186bb2f36b4f3ceda4c69bea8e22233.tar.bz2
u-boot-e497fabb9186bb2f36b4f3ceda4c69bea8e22233.zip
clk: initialize clk->data when using default xlate
Right now when using clk_of_xlate_default(), clk->data remains un-initialized because clk_get_bulk() does not initialize memory on allocation of clock structure. This can cause problems when data is used to match if two clocks pointers are exactly the same underlying clocks, for example. Fix it by initializing clk->data to 0. Suggested-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk-uclass.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 79b3b0494c..06a8258d5f 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -51,6 +51,8 @@ static int clk_of_xlate_default(struct clk *clk,
else
clk->id = 0;
+ clk->data = 0;
+
return 0;
}