linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: add unregister function for fixed factor clock and fixed rate clock
@ 2016-01-06  4:25 Masahiro Yamada
  2016-01-06  4:25 ` [PATCH 1/2] clk: add clk_unregister_fixed_factor() Masahiro Yamada
  2016-01-06  4:25 ` [PATCH 2/2] clk: add clk_unregister_fixed_rate() Masahiro Yamada
  0 siblings, 2 replies; 5+ messages in thread
From: Masahiro Yamada @ 2016-01-06  4:25 UTC (permalink / raw)
  To: linux-clk; +Cc: Masahiro Yamada, Stephen Boyd, Michael Turquette, linux-kernel


clk-mux and clk-gate have an unregister function,
but clk-fixed-rate and clk-fixed-factor do not.

I want to register/unregister clk-fixed-factor and clk-fixed-rate
from my SoC clock provider.



Masahiro Yamada (2):
  clk: add clk_unregister_fixed_factor()
  clk: add clk_unregister_fixed_rate()

 drivers/clk/clk-fixed-factor.c | 13 +++++++++++++
 drivers/clk/clk-fixed-rate.c   | 13 +++++++++++++
 include/linux/clk-provider.h   |  3 ++-
 3 files changed, 28 insertions(+), 1 deletion(-)

-- 
1.9.1


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

* [PATCH 1/2] clk: add clk_unregister_fixed_factor()
  2016-01-06  4:25 [PATCH 0/2] clk: add unregister function for fixed factor clock and fixed rate clock Masahiro Yamada
@ 2016-01-06  4:25 ` Masahiro Yamada
  2016-01-30  0:43   ` Stephen Boyd
  2016-01-06  4:25 ` [PATCH 2/2] clk: add clk_unregister_fixed_rate() Masahiro Yamada
  1 sibling, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2016-01-06  4:25 UTC (permalink / raw)
  To: linux-clk; +Cc: Masahiro Yamada, Stephen Boyd, Michael Turquette, linux-kernel

Allow to unregister fixed factor clock.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/clk/clk-fixed-factor.c | 13 +++++++++++++
 include/linux/clk-provider.h   |  1 +
 2 files changed, 14 insertions(+)

diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index 83de57a..f9c80e3 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -102,6 +102,19 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
 }
 EXPORT_SYMBOL_GPL(clk_register_fixed_factor);
 
+void clk_unregister_fixed_factor(struct clk *clk)
+{
+	struct clk_hw *hw;
+
+	hw = __clk_get_hw(clk);
+	if (!hw)
+		return;
+
+	clk_unregister(clk);
+	kfree(to_clk_fixed_factor(hw));
+}
+EXPORT_SYMBOL_GPL(clk_unregister_fixed_factor);
+
 #ifdef CONFIG_OF
 /**
  * of_fixed_factor_clk_setup() - Setup function for simple fixed factor clock
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index e7bd710..39edfd7 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -486,6 +486,7 @@ extern const struct clk_ops clk_fixed_factor_ops;
 struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
 		const char *parent_name, unsigned long flags,
 		unsigned int mult, unsigned int div);
+void clk_unregister_fixed_factor(struct clk *clk);
 
 /**
  * struct clk_fractional_divider - adjustable fractional divider clock
-- 
1.9.1


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

* [PATCH 2/2] clk: add clk_unregister_fixed_rate()
  2016-01-06  4:25 [PATCH 0/2] clk: add unregister function for fixed factor clock and fixed rate clock Masahiro Yamada
  2016-01-06  4:25 ` [PATCH 1/2] clk: add clk_unregister_fixed_factor() Masahiro Yamada
@ 2016-01-06  4:25 ` Masahiro Yamada
  2016-01-30  0:43   ` Stephen Boyd
  1 sibling, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2016-01-06  4:25 UTC (permalink / raw)
  To: linux-clk; +Cc: Masahiro Yamada, Stephen Boyd, Michael Turquette, linux-kernel

Allow to unregister fixed rate clock.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/clk/clk-fixed-rate.c | 13 +++++++++++++
 include/linux/clk-provider.h |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c
index f85ec8d..a69a6db 100644
--- a/drivers/clk/clk-fixed-rate.c
+++ b/drivers/clk/clk-fixed-rate.c
@@ -106,6 +106,19 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
 }
 EXPORT_SYMBOL_GPL(clk_register_fixed_rate);
 
+void clk_unregister_fixed_rate(struct clk *clk)
+{
+	struct clk_hw *hw;
+
+	hw = __clk_get_hw(clk);
+	if (!hw)
+		return;
+
+	clk_unregister(clk);
+	kfree(to_clk_fixed_rate(hw));
+}
+EXPORT_SYMBOL_GPL(clk_unregister_fixed_rate);
+
 #ifdef CONFIG_OF
 /**
  * of_fixed_clk_setup() - Setup function for simple fixed rate clock
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 39edfd7..b6c6bfb 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -282,7 +282,7 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
 struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev,
 		const char *name, const char *parent_name, unsigned long flags,
 		unsigned long fixed_rate, unsigned long fixed_accuracy);
-
+void clk_unregister_fixed_rate(struct clk *clk);
 void of_fixed_clk_setup(struct device_node *np);
 
 /**
-- 
1.9.1


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

* Re: [PATCH 1/2] clk: add clk_unregister_fixed_factor()
  2016-01-06  4:25 ` [PATCH 1/2] clk: add clk_unregister_fixed_factor() Masahiro Yamada
@ 2016-01-30  0:43   ` Stephen Boyd
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2016-01-30  0:43 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-clk, Michael Turquette, linux-kernel

On 01/06, Masahiro Yamada wrote:
> Allow to unregister fixed factor clock.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH 2/2] clk: add clk_unregister_fixed_rate()
  2016-01-06  4:25 ` [PATCH 2/2] clk: add clk_unregister_fixed_rate() Masahiro Yamada
@ 2016-01-30  0:43   ` Stephen Boyd
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2016-01-30  0:43 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-clk, Michael Turquette, linux-kernel

On 01/06, Masahiro Yamada wrote:
> Allow to unregister fixed rate clock.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

end of thread, other threads:[~2016-01-30  0:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-06  4:25 [PATCH 0/2] clk: add unregister function for fixed factor clock and fixed rate clock Masahiro Yamada
2016-01-06  4:25 ` [PATCH 1/2] clk: add clk_unregister_fixed_factor() Masahiro Yamada
2016-01-30  0:43   ` Stephen Boyd
2016-01-06  4:25 ` [PATCH 2/2] clk: add clk_unregister_fixed_rate() Masahiro Yamada
2016-01-30  0:43   ` Stephen Boyd

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