PCI: tegra: Fix reporting GPIO error value
authorPali Rohár <pali@kernel.org>
Tue, 14 Apr 2020 10:25:12 +0000 (12:25 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 11 May 2020 09:36:18 +0000 (10:36 +0100)
Error code is stored in rp->reset_gpio and not in err variable.

Link: https://lore.kernel.org/r/20200414102512.27506-1-pali@kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Rob Herring <robh@kernel.org>
drivers/pci/controller/pci-tegra.c

index 3e64ba6a36a83f3c1ae9e6f462ed10158363a250..e3e917243e1070de646222e0a1aa6d5a044ba10e 100644 (file)
@@ -2219,8 +2219,8 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
                        if (PTR_ERR(rp->reset_gpio) == -ENOENT) {
                                rp->reset_gpio = NULL;
                        } else {
-                               dev_err(dev, "failed to get reset GPIO: %d\n",
-                                       err);
+                               dev_err(dev, "failed to get reset GPIO: %ld\n",
+                                       PTR_ERR(rp->reset_gpio));
                                return PTR_ERR(rp->reset_gpio);
                        }
                }