linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: Properly initialize reference count
@ 2013-10-31 12:02 Thierry Reding
  2013-10-31 19:09 ` Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thierry Reding @ 2013-10-31 12:02 UTC (permalink / raw)
  To: linux-arm-kernel

Commit a336ed7 (clk: Implement clk_unregister()) initializes the kref in
clk_set_parent(), which is obviously the wrong place. Further research
shows that the original patches initialized it correctly, so it probably
ended up in clk_set_parent() by mistake during manual application of the
patch.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 6e3f485..b68a999 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1750,7 +1750,6 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 	else
 		__clk_recalc_rates(clk, POST_RATE_CHANGE);
 
-	kref_init(&clk->ref);
 out:
 	clk_prepare_unlock();
 
@@ -1906,6 +1905,7 @@ int __clk_init(struct device *dev, struct clk *clk)
 	if (clk->ops->init)
 		clk->ops->init(clk->hw);
 
+	kref_init(&clk->ref);
 out:
 	clk_prepare_unlock();
 
-- 
1.8.4

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

end of thread, other threads:[~2013-11-04  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31 12:02 [PATCH] clk: Properly initialize reference count Thierry Reding
2013-10-31 19:09 ` Stephen Warren
2013-11-01  9:23   ` Thierry Reding
2013-10-31 20:03 ` Fabio Estevam
2013-11-04  8:47 ` Jonas Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).