Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1302392
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] clk: add clk_unregister_fixed_factor() |
| Date | 2016-01-06 05:30 +0100 |
| Message-ID | <qNNTs-4yb-3@gated-at.bofh.it> (permalink) |
| References | <qNNTs-4yb-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
--
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 | Next 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