Re: [PATCH V3 02/10] init.h: Fix the __setup_param() macro for module build

From: Arnd Bergmann
Date: Wed Jul 01 2020 - 06:14:04 EST


On Wed, Jul 1, 2020 at 12:02 PM Anson Huang <anson.huang@xxxxxxx> wrote:
> > Subject: Re: [PATCH V3 02/10] init.h: Fix the __setup_param() macro for
> > module build
> > On Wed, Jul 1, 2020 at 11:27 AM Anson Huang <anson.huang@xxxxxxx>
> > wrote:
> > > > Subject: Re: [PATCH V3 02/10] init.h: Fix the __setup_param() macro
> > > > for module build
> > Why not move this all to a separate file then and only build it when
> > CONFIG_CLK_IMX=y?
> > It seems that you don't need the imx_keep_uart_clocks_param() if the clk
> > driver is loaded as a module, but then you also don't need the
> > imx_clk_disable_uart() and imx_register_uart_clocks() functions or the
> > associated variables.
>
> If so, how about just adding "#ifndef MODULE" check for this part of code? I think
> it should be easier/better than adding a file and build it conditionally?

The #ifdef is clearly a simpler change, but I think a separate file is
a cleaner way to do it. Up to you (unless one of the imx or clk maintainers
has a preference -- I'm only helping out here, not making decisions).

Arnd