Re: [PATCH] platform/x86: int3472: make common part a separate module

From: Andy Shevchenko
Date: Wed May 29 2024 - 10:29:03 EST


On Wed, May 29, 2024 at 5:14 PM Arnd Bergmann <arnd@xxxxxxxx> wrote:
> On Wed, May 29, 2024, at 15:41, Andy Shevchenko wrote:
> > On Wed, May 29, 2024 at 12:50 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:

..

> >> obj-$(CONFIG_INTEL_SKL_INT3472) += intel_skl_int3472_discrete.o \
> >> - intel_skl_int3472_tps68470.o
> >
> >> + intel_skl_int3472_tps68470.o \
> >> + intel_skl_int3472_common.o
> >
> > A nit: Can this be put above instead?
>
> I've changed it like this now, is that what you meant?
>
>
> obj-$(CONFIG_INTEL_SKL_INT3472) += intel_skl_int3472_common.o \
> intel_skl_int3472_discrete.o \
> intel_skl_int3472_tps68470.o \

Without the last trailing \, but yes.

> intel_skl_int3472_common-y += common.o
> intel_skl_int3472_discrete-y := discrete.o clk_and_regulator.o led.o
> intel_skl_int3472_tps68470-y := tps68470.o tps68470_board_data.o

..

> >> +EXPORT_SYMBOL_GPL(skl_int3472_get_sensor_adev_and_name);
> >
> > Are these namespaced?
>
> No, is there any advantage to making them namespaced?

Yes, to clean up the global namespace.

> It's only a few symbols and they have proper prefixes.

It's different from the exported namespace.
The function prefixes are needed due to C language, as we can't have
two functions named the same. The export OTOH is what used for linking
modules and if there is no need to have it exported globally, if, for
example, compiling in this one.

So, can we move to the exported namespace at the same time?

--
With Best Regards,
Andy Shevchenko