Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1302393
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/2] clk: add clk_unregister_fixed_rate() |
| Date | 2016-01-06 05:30 +0100 |
| Message-ID | <qNNTs-4yb-7@gated-at.bofh.it> (permalink) |
| References | <qNNTs-4yb-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 0/2] clk: add unregister function for fixed factor clock and fixed rate clock Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-01-06 05:30 +0100 [PATCH 1/2] clk: add clk_unregister_fixed_factor() Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-01-06 05:30 +0100 [PATCH 2/2] clk: add clk_unregister_fixed_rate() Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-01-06 05:30 +0100
csiph-web