]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: initialize clk->data when using default xlate
authorSekhar Nori <nsekhar@ti.com>
Thu, 11 Jul 2019 09:00:24 +0000 (14:30 +0530)
committerSimon Glass <sjg@chromium.org>
Wed, 24 Jul 2019 19:54:08 +0000 (12:54 -0700)
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>
drivers/clk/clk-uclass.c

index 79b3b0494c652c947ef9b114ebb48a97154b650f..06a8258d5faceb205404ffe4fed553b829feedac 100644 (file)
@@ -51,6 +51,8 @@ static int clk_of_xlate_default(struct clk *clk,
        else
                clk->id = 0;
 
+       clk->data = 0;
+
        return 0;
 }