From: Sekhar Nori Date: Thu, 11 Jul 2019 09:00:24 +0000 (+0530) Subject: clk: initialize clk->data when using default xlate X-Git-Tag: v2025.01-rc5-pxa1908~2870^2~2 X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/git-logo.png?a=commitdiff_plain;h=e497fabb9186bb2f36b4f3ceda4c69bea8e22233;p=u-boot.git 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 Signed-off-by: Sekhar Nori --- 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; }