]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PCI: tegra194: Fix probe path for Endpoint mode
authorVidya Sagar <vidyas@nvidia.com>
Mon, 8 Apr 2024 09:30:53 +0000 (15:00 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:35 +0000 (13:39 +0200)
[ Upstream commit 19326006a21da26532d982254677c892dae8f29b ]

Tegra194 PCIe probe path is taking failure path in success case for
Endpoint mode. Return success from the switch case instead of going
into the failure path.

Fixes: c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")
Link: https://lore.kernel.org/linux-pci/20240408093053.3948634-1-vidyas@nvidia.com
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/dwc/pcie-tegra194.c

index 2f82da76e3711e33ff675599a6cd3b5f71590bba..3703ea0d90c28fb09a7ffe3103f3964b0b2da408 100644 (file)
@@ -2142,10 +2142,13 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
                ret = tegra_pcie_config_ep(pcie, pdev);
                if (ret < 0)
                        goto fail;
+               else
+                       return 0;
                break;
 
        default:
                dev_err(dev, "Invalid PCIe device type %d\n", pcie->mode);
+               ret = -EINVAL;
        }
 
 fail: