All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] clk: initialize clk->data when using default xlate
@ 2019-07-11  9:00 Sekhar Nori
  2019-07-21  1:50 ` sjg at google.com
  0 siblings, 1 reply; 2+ messages in thread
From: Sekhar Nori @ 2019-07-11  9:00 UTC (permalink / raw)
  To: u-boot

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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 823be2bcb624..4a6fcd098a94 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;
 }
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] clk: initialize clk->data when using default xlate
  2019-07-11  9:00 [U-Boot] [PATCH] clk: initialize clk->data when using default xlate Sekhar Nori
@ 2019-07-21  1:50 ` sjg at google.com
  0 siblings, 0 replies; 2+ messages in thread
From: sjg at google.com @ 2019-07-21  1:50 UTC (permalink / raw)
  To: u-boot

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 | 2 ++
 1 file changed, 2 insertions(+)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-21  1:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11  9:00 [U-Boot] [PATCH] clk: initialize clk->data when using default xlate Sekhar Nori
2019-07-21  1:50 ` sjg at google.com

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.