Skip to content

Commit 95d9c3f

Browse files
PCI: keystone: Exit ks_pcie_probe() for invalid mode
Commit under Fixes introduced support for PCIe EP mode on AM654x platforms. When the mode happens to be either "DW_PCIE_RC_TYPE" or "DW_PCIE_EP_TYPE", the PCIe Controller is configured accordingly. However, when the mode is neither of them, an error message is displayed, but the driver probe succeeds. Since this "invalid" mode is not associated with a functional PCIe Controller, the probe should fail. Fix the behavior by exiting "ks_pcie_probe()" with the return value of "-EINVAL" in addition to displaying the existing error message when the mode is invalid. Fixes: 23284ad ("PCI: keystone: Add support for PCIe EP in AM654x Platforms") Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20251029080547.1253757-4-s-vadapalli@ti.com
1 parent 3a86608 commit 95d9c3f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,8 @@ static int ks_pcie_probe(struct platform_device *pdev)
13371337
break;
13381338
default:
13391339
dev_err(dev, "INVALID device type %d\n", mode);
1340+
ret = -EINVAL;
1341+
goto err_get_sync;
13401342
}
13411343

13421344
ks_pcie_enable_error_irq(ks_pcie);

0 commit comments

Comments
 (0)