Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1422660
| From | Jiancheng Xue <xuejiancheng@hisilicon.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 4/5] clk: hisilicon: add hisi_clk_unregister_* functions |
| Date | 2016-06-15 08:40 +0200 |
| Message-ID | <rKcEy-7oE-19@gated-at.bofh.it> (permalink) |
| References | <rKcEx-7oE-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Add hisi_clk_unregister_* functions.
Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
---
drivers/clk/hisilicon/clk.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/clk/hisilicon/clk.h b/drivers/clk/hisilicon/clk.h
index 2575329..4e1d1af 100644
--- a/drivers/clk/hisilicon/clk.h
+++ b/drivers/clk/hisilicon/clk.h
@@ -128,4 +128,25 @@ void hisi_clk_register_gate_sep(const struct hisi_gate_clock *,
int, struct hisi_clock_data *);
void hi6220_clk_register_divider(const struct hi6220_divider_clock *,
int, struct hisi_clock_data *);
+
+#define hisi_clk_unregister(type) \
+static inline \
+void hisi_clk_unregister_##type(const struct hisi_##type##_clock *clks, \
+ int nums, struct hisi_clock_data *data) \
+{ \
+ struct clk **clocks = data->clk_data.clks; \
+ int i; \
+ for (i = 0; i < nums; i++) { \
+ int id = clks[i].id; \
+ if (clocks[id]) \
+ clk_unregister_##type(clocks[id]); \
+ } \
+}
+
+hisi_clk_unregister(fixed_rate)
+hisi_clk_unregister(fixed_factor)
+hisi_clk_unregister(mux)
+hisi_clk_unregister(divider)
+hisi_clk_unregister(gate)
+
#endif /* __HISI_CLK_H */
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RESEND PATCH v2 0/5] clk: hisilicon: Fix some problems of clk-hi3519 Jiancheng Xue <xuejiancheng@hisilicon.com> - 2016-06-15 08:40 +0200 [PATCH v2 1/5] reset: hisilicon: change the definition of hisi_reset_init Jiancheng Xue <xuejiancheng@hisilicon.com> - 2016-06-15 08:40 +0200 [PATCH v2 4/5] clk: hisilicon: add hisi_clk_unregister_* functions Jiancheng Xue <xuejiancheng@hisilicon.com> - 2016-06-15 08:40 +0200 [PATCH v2 2/5] clk: hisilicon: add hisi_clk_alloc function. Jiancheng Xue <xuejiancheng@hisilicon.com> - 2016-06-15 08:40 +0200 [PATCH v2 5/5] clk: hisilicon: hi3519: add driver remove path and fix some issues Jiancheng Xue <xuejiancheng@hisilicon.com> - 2016-06-15 08:40 +0200
csiph-web