All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiancheng Xue <xuejiancheng@hisilicon.com>
To: <mturquette@baylibre.com>, <sboyd@codeaurora.org>,
	<p.zabel@pengutronix.de>
Cc: <linux-clk@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<yanhaifeng@hisilicon.com>, <yanghongwei@hisilicon.com>,
	Jiancheng Xue <xuejiancheng@hisilicon.com>
Subject: [PATCH v2 4/5] clk: hisilicon: add hisi_clk_unregister_* functions
Date: Wed, 15 Jun 2016 14:26:37 +0800	[thread overview]
Message-ID: <1465971998-29619-5-git-send-email-xuejiancheng@hisilicon.com> (raw)
In-Reply-To: <1465971998-29619-1-git-send-email-xuejiancheng@hisilicon.com>

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

  parent reply	other threads:[~2016-06-15  6:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15  6:26 [RESEND PATCH v2 0/5] clk: hisilicon: Fix some problems of clk-hi3519 Jiancheng Xue
2016-06-15  6:26 ` [PATCH v2 1/5] reset: hisilicon: change the definition of hisi_reset_init Jiancheng Xue
2016-06-15  6:26 ` [PATCH v2 2/5] clk: hisilicon: add hisi_clk_alloc function Jiancheng Xue
2016-06-30 19:36   ` Stephen Boyd
2016-06-15  6:26 ` [PATCH v2 3/5] clk: hisilicon: add error processing for hisi_clk_register_* functions Jiancheng Xue
2016-06-30 19:36   ` Stephen Boyd
2016-06-15  6:26 ` Jiancheng Xue [this message]
2016-06-30 19:36   ` [PATCH v2 4/5] clk: hisilicon: add hisi_clk_unregister_* functions Stephen Boyd
2016-06-15  6:26 ` [PATCH v2 5/5] clk: hisilicon: hi3519: add driver remove path and fix some issues Jiancheng Xue
2016-06-30 19:36   ` Stephen Boyd
2016-06-28  7:26 ` [RESEND PATCH v2 0/5] clk: hisilicon: Fix some problems of clk-hi3519 Jiancheng Xue
  -- strict thread matches above, loose matches on Subject: below --
2016-05-13  2:05 [PATCH " Jiancheng Xue
2016-05-13  2:05 ` [PATCH v2 4/5] clk: hisilicon: add hisi_clk_unregister_* functions Jiancheng Xue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465971998-29619-5-git-send-email-xuejiancheng@hisilicon.com \
    --to=xuejiancheng@hisilicon.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=sboyd@codeaurora.org \
    --cc=yanghongwei@hisilicon.com \
    --cc=yanhaifeng@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.