Re: [PATCH] PCI/pwrctl: reduce the amount of Kconfig noise

From: Linus Torvalds
Date: Tue Jul 16 2024 - 15:11:43 EST


On Tue, 16 Jul 2024 at 11:48, Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
>
> But this patch does it. PCI_PWRCTL_PWRSEQ becomes a hidden symbol and
> the entire submenu for PCI_PWRCTL disappears. There's no question in
> Kconfig anymore.

Yes, but look here:

default m if ((ATH11K_PCI || ATH12K) && ARCH_QCOM)

That has at least two issues:

- what if ATH11K_PCI or ATH12K is built-in and needs this driver?
"default m" is *NOT* valid.

- what happens when you add new drivers? You keep making this line
longer and more complicated?

See why I say "use select" instead? It means that the drivers that
need it can select it, and you avoid complicated "list X drivers"
things, but you can also get the *right* selection criteria, so that a
built-in driver will select a built-in PCI_PWRCTL_PWRSEQ option.

Linus