[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a31bZ1XDjjv1LRvpgifxqYUuBRFbPEc+eFD8Dby+mRE8Q@mail.gmail.com>
Date: Thu, 2 Jul 2020 09:03:32 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Dong Aisheng <dongas86@...il.com>
Cc: Anson Huang <anson.huang@....com>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Sascha Hauer <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Peng Fan <peng.fan@....com>, Abel Vesa <abel.vesa@....com>,
Aisheng Dong <aisheng.dong@....com>,
Andy Duan <fugang.duan@....com>,
Daniel Baluta <daniel.baluta@....com>,
YueHaibing <yuehaibing@...wei.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-clk <linux-clk@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>,
dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clock
driver as module
On Thu, Jul 2, 2020 at 8:40 AM Dong Aisheng <dongas86@...il.com> wrote:
> On Thu, Jul 2, 2020 at 2:11 PM Anson Huang <anson.huang@....com> wrote:
> > > Subject: Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clock
> >
> > I am fine of adding the '#ifndef MODULE' to imx_clk_disable_uart() and imx_keep_uart_clocks_param()
> > as well in next patch series. Others like ' imx_keep_uart_clocks ' and imx_register_uart_clocks() need to
> > be kept always built, since they are used by each clock driver no matter built-in or module build.
> >
> > So that means I have to add another 'ifndef MODULE' or I need to adjust some code sequence to make
> > those code can be built-out in same block and just use single 'ifndef MODULE', I think adjust the code
> > sequence should be better, will go with this way.
>
> What if we condionally compile it in clk.h? Will that be easiser?
Yes, that's what I expected to see in v4 after the previous discussion. If
imx_register_uart_clocks() is an empty inline function, then the arrays
passed to it are unused and also get dropped by the compiler.
The question is whether the #ifdef check in the header to test for MODULE
(only calling it if this particular soc has a built-in clk driver,
which is sufficient)
or for IS_MODULE(CONFIG_MXC_CLK) (call it if _any_ clk driver is built-in
and the function exists, which leaves extra code in the driver but is a more
conventional check).
Arnd
Powered by blists - more mailing lists