Skip to contentSkip to conversation

clk: initialize clk->data when using default xlate

PATCH New Sekhar Nori 2 participants 2 messages Jul 11, 2019 – Jul 21, 2019 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/clk/clk-uclass.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/clk-uclass.c +2 -0
index 823be2bcb624..4a6fcd098a94 100644
@@ -51,6 +51,8 @@ static int clk_of_xlate_default(struct clk *clk,
 	else
 		clk->id = 0;
 
+	clk->data = 0;
+
 	return 0;
 }
 
Signature · 1 line
2.16.2
#1 lore raw

PATCH 1/1 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.

---
 drivers/clk/clk-uclass.c | 2 ++
 1 file changed, 2 insertions(+)

Applied to u-boot-dm, thanks!