* [PATCH 1/2] clk: Prototype and document clk_register()
@ 2011-07-10 12:06 Mark Brown
2011-07-10 12:06 ` [PATCH 2/2] clk: Provide a dummy clk_unregister() Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2011-07-10 12:06 UTC (permalink / raw)
To: Jeremy Kerr; +Cc: linux-arm-kernel, linux-kernel, Mark Brown
This allows the compiler to ensure drivers are using the correct prototype.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
include/linux/clk.h | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 7c26135..2ca4f66 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -136,6 +136,18 @@ extern struct clk_hw_ops clk_gate_ops;
#endif /* CONFIG_GENERIC_CLK_GATE */
+/**
+ * clk_register - register and initialize a new clock
+ *
+ * @ops: ops for the new clock
+ * @hw: struct clk_hw to be passed to the ops of the new clock
+ * @name: name to use for the new clock
+ *
+ * Register a new clock with the clk subsytem. Returns either a
+ * struct clk for the new clock or a NULL pointer.
+ */
+struct clk *clk_register(struct clk_hw_ops *ops, struct clk_hw *hw,
+ const char *name);
#else /* !CONFIG_GENERIC_CLK */
--
1.7.5.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] clk: Provide a dummy clk_unregister()
2011-07-10 12:06 [PATCH 1/2] clk: Prototype and document clk_register() Mark Brown
@ 2011-07-10 12:06 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2011-07-10 12:06 UTC (permalink / raw)
To: Jeremy Kerr; +Cc: linux-arm-kernel, linux-kernel, Mark Brown
Even though unregistration is not actually supported by the clk API it is
still useful to provide a clk_unregister() so that drivers can implement
their unregistration code. This saves having to go back later and update
them once unregistration is possible.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
include/linux/clk.h | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 2ca4f66..df5c64f 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -149,6 +149,21 @@ extern struct clk_hw_ops clk_gate_ops;
struct clk *clk_register(struct clk_hw_ops *ops, struct clk_hw *hw,
const char *name);
+/**
+ * clk_unregister - remove a clock
+ *
+ * @clk: clock to unregister
+ *
+ * Remove a clock from the clk subsystem. This is currently not
+ * implemented but is provided to allow unregistration code to be
+ * written in drivers ready for use when an implementation is
+ * provided.
+ */
+static inline int clk_unregister(struct clk *clk)
+{
+ return -ENOTSUPP;
+}
+
#else /* !CONFIG_GENERIC_CLK */
/*
--
1.7.5.4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-10 12:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-10 12:06 [PATCH 1/2] clk: Prototype and document clk_register() Mark Brown
2011-07-10 12:06 ` [PATCH 2/2] clk: Provide a dummy clk_unregister() Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®