Re: [PATCH 0/4] Cleanup arm64 driver dependencies

From: Arnd Bergmann
Date: Thu Sep 12 2019 - 05:29:21 EST


On Thu, Sep 12, 2019 at 12:18 AM Amit Kucheria <amit.kucheria@xxxxxxxxxx> wrote:
>
> I was using initcall_debugging on a QCOM platform and ran across a bunch of
> driver initcalls that are enabled even if their SoC support is disabled.
>
> Here are some fixups for a subset of them.

The idea seems reasonable, disabling a platform may just turn off
all the drivers that are not useful elsewhere, but there are mistakes
in a lot of your changes, so I'm certainly not applying these for 5.4.

Generally speaking, the way that works best is

config SUBSYS_DRIVER_FOO
tristate "SUBSYS support for FOO platform"
depends on ARCH_FOO || COMPILE_TEST
depends on SUBSYS
default "m" if ARCH_FOO

This means it's enabled as a loadable module by default (use
default "y" instead where necessary) as long as the platform
is enabled, but an x86 allmodconfig build also includes it
because of COMPILE_TEST, while any configuration without
ARCH_FOO that is not compile-testing cannot enable it.

Arnd