linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: Register clkdev after setup of fixed-rate and fixed-factor clocks
@ 2016-10-11 11:13 Orson Zhai
  2016-10-20 23:01 ` Stephen Boyd
  0 siblings, 1 reply; 9+ messages in thread
From: Orson Zhai @ 2016-10-11 11:13 UTC (permalink / raw)
  To: mturquette, sboyd
  Cc: baolin.wang, xiaolong.zhang, linux-clk, linux-kernel, ben.li,
	Orson Zhai

From: Xiaolong Zhang <xiaolong.zhang@spreadtrum.com>

When common kernel setups fixed clock, of_clk_provider will be registerred.
But there is no clkdev being registerred at the same time. This will make
it difficult to get the clock by using clk_get(NULL, con_id).

Add clkdev register for fixed-rate and fixed-factor clock and ignore
the error if any.

Signed-off-by: Xiaolong Zhang <xiaolong.zhang@spreadtrum.com>
Signed-off-by: Orson Zhai <orson.zhai@spreadtrum.com>
---
 drivers/clk/clk-fixed-factor.c | 5 +++++
 drivers/clk/clk-fixed-rate.c   | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index a5d402d..b81656a 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -9,6 +9,7 @@
  */
 #include <linux/module.h>
 #include <linux/clk-provider.h>
+#include <linux/clkdev.h>
 #include <linux/slab.h>
 #include <linux/err.h>
 #include <linux/of.h>
@@ -186,6 +187,10 @@ static struct clk *_of_fixed_factor_clk_setup(struct device_node *node)
 		return ERR_PTR(ret);
 	}
 
+#ifdef CONFIG_CLKDEV_LOOKUP
+	clk_register_clkdev(clk, clk_name, 0);
+#endif
+
 	return clk;
 }
 
diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c
index b5c46b3..d42c8e7 100644
--- a/drivers/clk/clk-fixed-rate.c
+++ b/drivers/clk/clk-fixed-rate.c
@@ -10,6 +10,7 @@
  */
 
 #include <linux/clk-provider.h>
+#include <linux/clkdev.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/io.h>
@@ -184,6 +185,10 @@ static struct clk *_of_fixed_clk_setup(struct device_node *node)
 		return ERR_PTR(ret);
 	}
 
+#ifdef CONFIG_CLKDEV_LOOKUP
+	clk_register_clkdev(clk, clk_name, 0);
+#endif
+
 	return clk;
 }
 
-- 
1.9.1

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

end of thread, other threads:[~2016-12-03  5:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 11:13 [PATCH] clk: Register clkdev after setup of fixed-rate and fixed-factor clocks Orson Zhai
2016-10-20 23:01 ` Stephen Boyd
2016-10-22  8:14   ` Xiaolong Zhang
2016-10-25 20:40     ` Stephen Boyd
2016-11-12  5:19       ` Xiaolong Zhang
2016-11-24  0:38         ` Stephen Boyd
2016-11-24  7:39           ` Xiaolong Zhang
2016-11-29 21:10             ` Stephen Boyd
2016-12-03  5:46               ` Xiaolong Zhang

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).