]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: keystone: Exit ks_pcie_probe() for invalid mode
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Wed, 29 Oct 2025 08:04:51 +0000 (13:34 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:59 +0000 (14:02 +0100)
commit59a8b59c5a49ea1827be080d5726436949f0cceb
tree6e7fa0b7cd11ee16c81bce66de2a20ac46383c9d
parent4a03d69cece145e4fb527464be29c3806aa3221e
PCI: keystone: Exit ks_pcie_probe() for invalid mode

[ Upstream commit 95d9c3f0e4546eaec0977f3b387549a8463cd49f ]

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: 23284ad677a9 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/dwc/pci-keystone.c