linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miles Chen <miles.chen@mediatek.com>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>
Cc: Miles Chen <miles.chen@mediatek.com>,
	Chun-Jie Chen <chun-jie.chen@mediatek.com>,
	Chen-Yu Tsai <wenst@chromium.org>, <linux-clk@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 2/3] clk: mediatek: clk-mt8192: drop CLK_OF_DECLARE_DRIVER
Date: Tue, 11 Jan 2022 01:09:58 +0800	[thread overview]
Message-ID: <20220110171000.24316-3-miles.chen@mediatek.com> (raw)
In-Reply-To: <20220110171000.24316-1-miles.chen@mediatek.com>

clk-mt8192.c uses CLK_OF_DECLARE_DRIVER and it does not work for
kernel modules.

To support clk-mt8192 moudle build, move the
clk_mt8192_top_init_early() logic to clk_mt8192_top_probe()
and drop clk_mt8192_top_init_early() and CLK_OF_DECLARE_DRIVER.

Cc: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 drivers/clk/mediatek/clk-mt8192.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8192.c b/drivers/clk/mediatek/clk-mt8192.c
index cbc7c6dbe0f4..552fae4f0fd5 100644
--- a/drivers/clk/mediatek/clk-mt8192.c
+++ b/drivers/clk/mediatek/clk-mt8192.c
@@ -1179,31 +1179,20 @@ static const struct mtk_pll_data plls[] = {
 
 static struct clk_onecell_data *top_clk_data;
 
-static void clk_mt8192_top_init_early(struct device_node *node)
+static int clk_mt8192_top_probe(struct platform_device *pdev)
 {
+	struct device_node *node = pdev->dev.of_node;
+	int r;
+	void __iomem *base;
 	int i;
 
 	top_clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
 	if (!top_clk_data)
-		return;
+		return -ENOMEM;
 
 	for (i = 0; i < CLK_TOP_NR_CLK; i++)
 		top_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
 
-	mtk_clk_register_factors(top_early_divs, ARRAY_SIZE(top_early_divs), top_clk_data);
-
-	of_clk_add_provider(node, of_clk_src_onecell_get, top_clk_data);
-}
-
-CLK_OF_DECLARE_DRIVER(mt8192_topckgen, "mediatek,mt8192-topckgen",
-		      clk_mt8192_top_init_early);
-
-static int clk_mt8192_top_probe(struct platform_device *pdev)
-{
-	struct device_node *node = pdev->dev.of_node;
-	int r;
-	void __iomem *base;
-
 	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
-- 
2.18.0


  parent reply	other threads:[~2022-01-10 17:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220110171000.24316-1-miles.chen@mediatek.com>
2022-01-10 17:09 ` [PATCH 1/3] clk: mediatek: export mtk_clk_simple_probe Miles Chen
2022-01-14  2:12   ` Stephen Boyd
2022-01-10 17:09 ` Miles Chen [this message]
2022-01-10 17:09 ` [PATCH 3/3] clk: mediatek: support COMMON_CLK_MT8192 module build Miles Chen
2022-01-14  2:11   ` Stephen Boyd
     [not found]     ` <20220114083511.18906-1-miles.chen@mediatek.com>
2022-01-14 22:19       ` Stephen Boyd

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=20220110171000.24316-3-miles.chen@mediatek.com \
    --to=miles.chen@mediatek.com \
    --cc=chun-jie.chen@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=wenst@chromium.org \
    /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 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).