LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Miles Chen <miles.chen@mediatek.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Wendell Lin <wendell.lin@mediatek.com>,
"Hanks Chen" <hanks.chen@mediatek.com>,
<linux-clk@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>, <wsd_upstream@mediatek.com>,
Lee Jones <lee.jones@linaro.org>
Subject: Re: [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 module build
Date: Tue, 31 Aug 2021 02:43:04 +0800 [thread overview]
Message-ID: <1630348984.24981.2.camel@mtkswgap22> (raw)
In-Reply-To: <163021049667.2676726.10138202396240942833@swboyd.mtv.corp.google.com>
On Sat, 2021-08-28 at 21:14 -0700, Stephen Boyd wrote:
> Quoting Miles Chen (2021-08-12 20:24:28)
> > diff --git a/drivers/clk/mediatek/clk-mt6779-aud.c b/drivers/clk/mediatek/clk-mt6779-aud.c
> > index 11b209f95e25..439c0bc94b73 100644
> > --- a/drivers/clk/mediatek/clk-mt6779-aud.c
> > +++ b/drivers/clk/mediatek/clk-mt6779-aud.c
> > @@ -4,6 +4,7 @@
> > * Author: Wendell Lin <wendell.lin@mediatek.com>
> > */
> >
> > +#include <linux/module.h>
> > #include <linux/clk-provider.h>
> > #include <linux/of.h>
> > #include <linux/of_address.h>
> > @@ -115,3 +116,4 @@ static struct platform_driver clk_mt6779_aud_drv = {
> > };
> >
> > builtin_platform_driver(clk_mt6779_aud_drv);
> > +MODULE_LICENSE("GPL");
>
> How does this work? builtin_platform_driver() means that it's not
> modular code. Shouldn't that be module_platform_driver()? Have you tried
> loading and unloading the module?
sorry for my late response.
Thanks for pointing this out. I have the same question when I was
building this patch. That time I found some examples where
they are using builtin_platform_driver and can be built as
kernel modules:
config CLK_IMX8QXP (tristate) && drivers/clk/imx/clk-imx8qxp-lpcg.c
config CLK_RK3399 (tristate) && drivers/clk/rockchip/clk-rk3399.c
my load test:
load these moduless and do 'lsmod' on v5.14-rc1/mt6779 environment:
clk_mt6779_aud 16384 0 [permanent], Live 0xffff800008fd8000
clk_mt6779_mfg 16384 0 [permanent], Live 0xffff800008fd0000
clk_mt6779_venc 16384 0 [permanent], Live 0xffff800008fc8000
clk_mt6779_vdec 16384 0 [permanent], Live 0xffff800008fc0000
clk_mt6779_cam 16384 0 [permanent], Live 0xffff800008fb8000
clk_mt6779_ipe 16384 0 [permanent], Live 0xffff800008fb0000
clk_mt6779_img 16384 0 [permanent], Live 0xffff800008fa8000
clk_mt6779_mm 16384 0 [permanent], Live 0xffff800008fa0000
I did not test 'unload' kernel modules because I did not
define module_exit in this patch.
But as you pointed out, it should be module_platform_driver().
I will use module_platform_driver() in the next patch.
Miles
next prev parent reply other threads:[~2021-08-30 18:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 3:24 [RESEND PATCH 0/4] clk: mediatek: modularize COMMON_CLK_MT6779 Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 1/4] clk: composite: export clk_register_composite Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 2/4] clk: mediatek: support COMMON_CLK_MEDIATEK module build Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 " Miles Chen
2021-08-29 4:14 ` Stephen Boyd
2021-08-30 18:43 ` Miles Chen [this message]
2021-09-01 5:32 ` Stephen Boyd
2021-09-01 22:04 ` Miles Chen
2021-08-13 3:24 ` [RESEND PATCH 4/4] clk: mediatek: use tristate for COMMON_CLK_MEDAITEK and COMMON_CLK_MT6779 Miles Chen
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=1630348984.24981.2.camel@mtkswgap22 \
--to=miles.chen@mediatek.com \
--cc=hanks.chen@mediatek.com \
--cc=lee.jones@linaro.org \
--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=wendell.lin@mediatek.com \
--cc=wsd_upstream@mediatek.com \
--subject='Re: [RESEND PATCH 3/4] clk: mediatek: support COMMON_CLK_MT6779 module build' \
/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
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).