From: Elaine Zhang <zhangqing@rock-chips.com>
To: mturquette@baylibre.com, sboyd@kernel.org,
kever.yang@rock-chips.com, zhangqing@rock-chips.com,
heiko@sntech.de, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-clk@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-kernel@vger.kernel.org, huangtao@rock-chips.com,
xxx@rock-chips.com, xf@rock-chips.com
Subject: [PATCH v1 5/8] clk: rockchip: rk3399: Support module build
Date: Mon, 18 Sep 2023 15:31:48 +0800 [thread overview]
Message-ID: <20230918073151.7660-6-zhangqing@rock-chips.com> (raw)
In-Reply-To: <20230918073151.7660-1-zhangqing@rock-chips.com>
support CLK_OF_DECLARE and module_platform_driver
double clk init method.
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
drivers/clk/rockchip/clk-rk3399.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c
index ee3bda968574..dcc794dbb190 100644
--- a/drivers/clk/rockchip/clk-rk3399.c
+++ b/drivers/clk/rockchip/clk-rk3399.c
@@ -1571,6 +1571,7 @@ static void __init rk3399_pmu_clk_init(struct device_node *np)
}
CLK_OF_DECLARE(rk3399_cru_pmu, "rockchip,rk3399-pmucru", rk3399_pmu_clk_init);
+#ifdef MODULE
struct clk_rk3399_inits {
void (*inits)(struct device_node *np);
};
@@ -1593,8 +1594,9 @@ static const struct of_device_id clk_rk3399_match_table[] = {
},
{ }
};
+MODULE_DEVICE_TABLE(of, clk_rk3399_match_table);
-static int __init clk_rk3399_probe(struct platform_device *pdev)
+static int clk_rk3399_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
const struct of_device_id *match;
@@ -1612,10 +1614,16 @@ static int __init clk_rk3399_probe(struct platform_device *pdev)
}
static struct platform_driver clk_rk3399_driver = {
+ .probe = clk_rk3399_probe,
.driver = {
.name = "clk-rk3399",
.of_match_table = clk_rk3399_match_table,
.suppress_bind_attrs = true,
},
};
-builtin_platform_driver_probe(clk_rk3399_driver, clk_rk3399_probe);
+module_platform_driver(clk_rk3399_driver);
+
+MODULE_DESCRIPTION("Rockchip RK3399 Clock Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:clk-rk3399");
+#endif /* MODULE */
--
2.17.1
next prev parent reply other threads:[~2023-09-18 7:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 7:31 [PATCH v1 0/8] clk: rockchip: Support module build Elaine Zhang
2023-09-18 7:31 ` [PATCH v1 1/8] clk: clk-fractional-divider: Export clk_fractional_divider_general_approximation API Elaine Zhang
2023-09-18 7:31 ` [PATCH v1 2/8] clk: rockchip: drop use of rockchip_clk_protect_critical() Elaine Zhang
2023-09-18 7:31 ` [PATCH v1 3/8] dt-bindings: clock: rk3188: Add binding id for ACLK_CPU_PRE Elaine Zhang
2023-09-18 12:16 ` Krzysztof Kozlowski
2023-09-18 7:31 ` [PATCH v1 4/8] clk: rockchip: Avoid __clk_lookup() calls Elaine Zhang
2023-09-18 13:32 ` kernel test robot
2023-09-18 17:07 ` kernel test robot
2023-09-18 7:31 ` Elaine Zhang [this message]
2023-09-18 7:31 ` [PATCH v1 6/8] clk: rockchip: rk3568: Support module build Elaine Zhang
2023-09-18 7:31 ` [PATCH v1 7/8] clk: rockchip: rk3588: " Elaine Zhang
2023-09-18 7:31 ` [PATCH v1 8/8] clk: rockchip: fix the clk config to support " Elaine Zhang
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=20230918073151.7660-6-zhangqing@rock-chips.com \
--to=zhangqing@rock-chips.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=huangtao@rock-chips.com \
--cc=kever.yang@rock-chips.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=xf@rock-chips.com \
--cc=xxx@rock-chips.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 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).