Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clock driver as module
From: Arnd Bergmann <arnd@arndb.de>
Date: 2020-07-02 07:03:54
Also in:
linux-clk, lkml
On Thu, Jul 2, 2020 at 8:40 AM Dong Aisheng [off-list ref] wrote:
On Thu, Jul 2, 2020 at 2:11 PM Anson Huang [off-list ref] wrote:quoted
quoted
Subject: Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clockI 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel