[PATCH] PCI: cadence: Kconfig: change PCIE_CADENCE configs from tristate to bool

Arnd Bergmann arnd at arndb.de
Mon Nov 17 01:06:57 PST 2025


On Mon, Nov 17, 2025, at 07:05, Siddharth Vadapalli wrote:
> On Fri, 2025-11-14 at 08:03 +0100, Arnd Bergmann wrote:
>> On Fri, Nov 14, 2025, at 06:47, Siddharth Vadapalli wrote:

> I understand that the solution should be fixing the pci-j721e.c driver
> rather than updating Kconfig or Makefile. Thank you for the feedback. I
> will update the pci-j721e.c driver to handle the case that is triggering
> the build error.

Ok, thanks!

I think a single if(IS_ENABLED(CONFIG_PCI_J721E_HOST)) check
is probably enough to avoid the link failure

--- a/drivers/pci/controller/cadence/pci-j721e.c
+++ b/drivers/pci/controller/cadence/pci-j721e.c
@@ -669,7 +669,8 @@ static void j721e_pcie_remove(struct platform_device *pdev)
        struct cdns_pcie_ep *ep;
        struct cdns_pcie_rc *rc;
 
-       if (pcie->mode == PCI_MODE_RC) {
+       if (IS_ENABLED(CONFIG_PCI_J721E_HOST) &&
+           pcie->mode == PCI_MODE_RC) {
                rc = container_of(cdns_pcie, struct cdns_pcie_rc, pcie);
                cdns_pcie_host_disable(rc);


but you may want to split it up further to get better dead
code elimination and prevent similar bugs from reappearing when
another call gets added without this type of check.

If you split j721e_pcie_driver into a host and an ep driver
structure with their own probe/remove callbacks, you can
move the IS_ENABLED() check all the way into module_init()
function.

     Arnd



More information about the linux-arm-kernel mailing list