diff mbox series

[V1] PCI: tegra194: Fix probe path for Endpoint mode

Message ID 20240401150116.298069-1-vidyas@nvidia.com (mailing list archive)
State Superseded
Headers show
Series [V1] PCI: tegra194: Fix probe path for Endpoint mode | expand

Commit Message

Vidya Sagar April 1, 2024, 3:01 p.m. UTC
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.

Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
---
 drivers/pci/controller/dwc/pcie-tegra194.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jon Hunter April 2, 2024, 12:39 p.m. UTC | #1
On 01/04/2024 16:01, Vidya Sagar wrote:
> 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.
> 
> Signed-off-by: Vidya Sagar <vidyas@nvidia.com>

Fixes: c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")

> ---
>   drivers/pci/controller/dwc/pcie-tegra194.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index 4bba31502ce1..1a8178dc899a 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -2273,11 +2273,14 @@ 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->of_data->mode);
> +		ret = -EINVAL;
>   	}
>   
>   fail:


Otherwise ...

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>

Jon
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 4bba31502ce1..1a8178dc899a 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -2273,11 +2273,14 @@  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->of_data->mode);
+		ret = -EINVAL;
 	}
 
 fail: