summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorVidya Sagar <vidyas@nvidia.com>2020-12-03 16:34:50 +0300
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2020-12-07 19:43:52 +0300
commit3d710af75bcdea2e9cb8cdb2f7663cef7b133f5e (patch)
tree88aee7b0b79cb3959b68aa7e73d886f591e51ccf /drivers/pci
parentb8f0d67149acf762861f9b02bc3d5bd49b2f72bd (diff)
downloadlinux-3d710af75bcdea2e9cb8cdb2f7663cef7b133f5e.tar.xz
PCI: tegra: Check return value of tegra_pcie_init_controller()
The return value of tegra_pcie_init_controller() must be checked before PCIe link up check and registering debugfs entries subsequently as it doesn't make sense to do these when the controller initialization itself has failed. Link: https://lore.kernel.org/r/20201203133451.17716-5-vidyas@nvidia.com Tested-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Vidya Sagar <vidyas@nvidia.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/controller/dwc/pcie-tegra194.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 471c6d725c70..f4109d71f20b 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1563,7 +1563,11 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie)
goto fail_pm_get_sync;
}
- tegra_pcie_init_controller(pcie);
+ ret = tegra_pcie_init_controller(pcie);
+ if (ret < 0) {
+ dev_err(dev, "Failed to initialize controller: %d\n", ret);
+ goto fail_pm_get_sync;
+ }
pcie->link_state = tegra_pcie_dw_link_up(&pcie->pci);
if (!pcie->link_state) {