power: sequencing: pcie-m2: enforce PCI and OF dependencies
PATCH 1/1 power: sequencing: pcie-m2: enforce PCI and OF dependencies
From: Arnd Bergmann <[email protected]>
The driver fails to build when PCI is disabled:
drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_pcie_m2_register_notifier':drivers/power/sequencing/pwrseq-pcie-m2.c:368:54: error: 'pci_bus_type' undeclared (first use in this function); did you mean 'pci_pcie_type'?
368 | ret = bus_register_notifier(&pci_bus_type, &ctx->nb);
| ^~~~~~~~~~~~
| pci_pcie_typeSimilarly, when CONFIG_OF is disabled:
drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_m2_pcie_create_bt_node':drivers/power/sequencing/pwrseq-pcie-m2.c:191:9: error: implicit declaration of function 'of_changeset_init' [-Wimplicit-function-declaration]
191 | of_changeset_init(ctx->ocs);
| ^~~~~~~~~~~~~~~~~Make both dependencies unconditional to prevent compile-testing in either configuration.
--- drivers/power/sequencing/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/power/sequencing/Kconfig +3 -2
@@ -37,8 +37,9 @@ config POWER_SEQUENCING_TH1520_GPU config POWER_SEQUENCING_PCIE_M2 tristate "PCIe M.2 connector power sequencing driver" - depends on (PCI && OF) || COMPILE_TEST - select OF_DYNAMIC if OF + depends on OF + depends on PCI + select OF_DYNAMIC help Say Y here to enable the power sequencing driver for PCIe M.2 connectors. This driver handles the power sequencing for the M.2
Signature · 1 line
2.39.5
Quoted 15 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The driver fails to build when PCI is disabled:
drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_pcie_m2_register_notifier':drivers/power/sequencing/pwrseq-pcie-m2.c:368:54: error: 'pci_bus_type' undeclared (first use in this function); did you mean 'pci_pcie_type'?368 | ret = bus_register_notifier(&pci_bus_type, &ctx->nb); | ^~~~~~~~~~~~ | pci_pcie_typeSimilarly, when
CONFIG_OFis disabled:
drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_m2_pcie_create_bt_node':drivers/power/sequencing/pwrseq-pcie-m2.c:191:9: error: implicit declaration of function 'of_changeset_init' [-Wimplicit-function-declaration]
Quoted 8 lines
191 | of_changeset_init(ctx->ocs); | ^~~~~~~~~~~~~~~~~Make both dependencies unconditional to prevent compile-testing in either configuration.
Fixes 3f736aecbdc8 ("power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth")Signed-off-by Arnd Bergmann <[email protected]>
Kind regards
Uffe
Quoted 23 lines
--- drivers/power/sequencing/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/power/sequencing/Kconfig +3
-3@@ -37,8 +37,9 @@ config POWER_SEQUENCING_TH1520_GPU config POWER_SEQUENCING_PCIE_M2 tristate "PCIe M.2 connector power sequencing driver" - depends on (PCI && OF) || COMPILE_TEST - select OF_DYNAMIC if OF + depends on OF + depends on PCI + select OF_DYNAMIC help Say Y here to enable the power sequencing driver for PCIe M.2 connectors. This driver handles the power sequencing for the M.2 --2.39.5
Bartosz Golaszewski
maintainerQuoted 15 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The driver fails to build when PCI is disabled:
drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_pcie_m2_register_notifier':drivers/power/sequencing/pwrseq-pcie-m2.c:368:54: error: 'pci_bus_type' undeclared (first use in this function); did you mean 'pci_pcie_type'?368 | ret = bus_register_notifier(&pci_bus_type, &ctx->nb); | ^~~~~~~~~~~~ | pci_pcie_typeSimilarly, when
CONFIG_OFis disabled:
drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_m2_pcie_create_bt_node':drivers/power/sequencing/pwrseq-pcie-m2.c:191:9: error: implicit declaration of function 'of_changeset_init' [-Wimplicit-function-declaration]
Quoted 8 lines
191 | of_changeset_init(ctx->ocs); | ^~~~~~~~~~~~~~~~~Make both dependencies unconditional to prevent compile-testing in either configuration.
Fixes 3f736aecbdc8 ("power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth")Signed-off-by Arnd Bergmann <[email protected]>
Hi Arnd,
Mani posted the following series[1]. It seems to me it fixes at least some of the build issues.
I would really prefer to keep the COMPILE_TEST option here. I'm seeing that only some of the symbols depending on OF_DYNAMIC are stubbed out.
Rob: is there any reason for that? Would you be willing to Ack a patch adding stubs for the remainder and me taking it along with the pwrseq changes?
Quoted 21 lines
--- drivers/power/sequencing/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/power/sequencing/Kconfig +3
-3@@ -37,8 +37,9 @@ config POWER_SEQUENCING_TH1520_GPU config POWER_SEQUENCING_PCIE_M2 tristate "PCIe M.2 connector power sequencing driver" - depends on (PCI && OF) || COMPILE_TEST - select OF_DYNAMIC if OF + depends on OF + depends on PCI + select OF_DYNAMIC help Say Y here to enable the power sequencing driver for PCIe M.2 connectors. This driver handles the power sequencing for the M.2 --
Quoted 2 lines
2.39.5
Bart
Quoted 6 lines · Bartosz Golaszewski
On Wed, Apr 1, 2026 at 11:19 AM Arnd Bergmann <[email protected]> wrote:
Hi Arnd,
Mani posted the following series[1]. It seems to me it fixes at least some of the build issues.
I don't think that covers the case of CONFIG_SERIAL_DEV_BUS=m with POWER_SEQUENCING_PCIE_M2. Trying to make this work with compile testing adds a lot of complexity for little benefit, so I think my second patch is better there. SERIAL_DEV_BUS is visible on all architectures, so compile-testing works fine on allmodconfig and randconfig builds either way.
For PCI it's similar: while you can't build test this on architectures without PCI (m68k, hexagon, ...), nobody cares, and you just make the driver uglier, though there is less risk of introducing additional regressions here.
Obviously the m2 pwrseq driver has a real dependency on pcie, so there is no point trying to make it build with PCI=n, the same way we don't allow building normal PCI device drivers without PCI support.
Quoted 5 lines
I would really prefer to keep the
COMPILE_TESToption here. I'm seeing that only some of the symbols depending onOF_DYNAMICare stubbed out.
Rob: is there any reason for that? Would you be willing to Ack a patch adding stubs for the remainder and me taking it along with the pwrseq changes?
The idea with OF_DYNAMIC is that any driver that uses it should 'select' that symbol, so there is no need for stubs.
More generally: I think the stub helpers in headers are useful for features that are truly optional, e.g. a driver may be able to light LEDs if they are enabled but still work fine without that. COMPILE_TEST in turn is nice when it enables building platform specific drivers on other platforms. The combination of the two causes more problems than it helps: if a driver has a clear dependency on a particular subsystem, we should just enforce that in Kconfig and not artificially allow compile testing a configuration that is neither useful in practice nor hard to build test already.
Arnd
Bartosz Golaszewski
AppliedQuoted 9 lines · Arnd Bergmann
The driver fails to build when PCI is disabled:
drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_pcie_m2_register_notifier':drivers/power/sequencing/pwrseq-pcie-m2.c:368:54: error: 'pci_bus_type' undeclared (first use in this function); did you mean 'pci_pcie_type'?368 | ret = bus_register_notifier(&pci_bus_type, &ctx->nb); | ^~~~~~~~~~~~ | pci_pcie_type[...]
Applied, thanks!
[1/1] power: sequencing: pcie-m2: enforce PCI and OF dependencies
https://git.kernel.org/brgl/c/19b8c8fc83f755cd52a2aa3dbdb091234592252e
Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>