[PATCH] PCI: xilinx-cpm: Fix incorrect version check in init_port

Thippeswamy Havalige
2025-03-11T07:24:13Z

Fix an incorrect conditional check in xilinx_cpm_pcie_init_port().

The previous condition mistakenly skipped initialization for all
versions except CPM5NC_HOST. This is now corrected to ensure that only
the CPM5NC_HOST is skipped while other versions proceed with
initialization.

Signed-off-by: Thippeswamy Havalige <thippeswamy.havalige@amd.com>
Fixes: 3f62f3280275 ("PCI: xilinx-cpm: Add support for Versal Net CPM5NC
Root Port controller")
---
drivers/pci/controller/pcie-xilinx-cpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-xilinx-cpm.c b/drivers/pci/controller/pcie-xilinx-cpm.c
index c2dd6fda905f..d0ab187d917f 100644
--- a/drivers/pci/controller/pcie-xilinx-cpm.c
+++ b/drivers/pci/controller/pcie-xilinx-cpm.c
@@ -479,7 +479,7 @@ static void xilinx_cpm_pcie_init_port(struct xilinx_cpm_pcie *port)
{
const struct xilinx_cpm_variant *variant = port->variant;

- if (variant->version != CPM5NC_HOST)
+ if (variant->version == CPM5NC_HOST)
return;

if (cpm_pcie_link_up(port))
--
2.43.0