Skip to contentSkip to conversation

PCI: tegra: Don't print an error on -EPROBE_DEFER

PATCH In review Vidya Sagar 2 participants 2 messages Aug 23, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: tegra: Don't print an error on -EPROBE_DEFER

APIs like devm_regulator_get() and devm_phy_get() have the potential to return -EPROBE_DEFER when the respective sub-systems are not ready yet. So avoid printing an error message as .probe() will be tried out again at a later point of time anyway.

---
 drivers/pci/controller/dwc/pcie-tegra194.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/pci/controller/dwc/pcie-tegra194.c +7 -4
index fc0dbeb31d78..c730986ed34d 100644
@@ -1368,9 +1368,11 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
 
 	pcie->pex_ctl_supply = devm_regulator_get(dev, "vddio-pex-ctl");
 	if (IS_ERR(pcie->pex_ctl_supply)) {
-		dev_err(dev, "Failed to get regulator: %ld\n",
-			PTR_ERR(pcie->pex_ctl_supply));
-		return PTR_ERR(pcie->pex_ctl_supply);
+		ret = PTR_ERR(pcie->pex_ctl_supply);
+		if (ret != -EPROBE_DEFER)
+			dev_err(dev, "Failed to get regulator: %ld\n",
+				PTR_ERR(pcie->pex_ctl_supply));
+		return ret;
 	}
 
 	pcie->core_clk = devm_clk_get(dev, "core");
@@ -1412,7 +1414,8 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
 		kfree(name);
 		if (IS_ERR(phys[i])) {
 			ret = PTR_ERR(phys[i]);
-			dev_err(dev, "Failed to get PHY: %d\n", ret);
+			if (ret != -EPROBE_DEFER)
+				dev_err(dev, "Failed to get PHY: %d\n", ret);
 			return ret;
 		}
 	}
Signature · 1 line
2.17.1
#1 lore raw
Quoted 9 lines · Vidya Sagar

APIs like devm_regulator_get() and devm_phy_get() have the potential to return -EPROBE_DEFER when the respective sub-systems are not ready yet. So avoid printing an error message as .probe() will be tried out again at a later point of time anyway.

---
 drivers/pci/controller/dwc/pcie-tegra194.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Squashed in pci/tegra, thanks.

Lorenzo

Quoted 32 lines
drivers/pci/controller/dwc/pcie-tegra194.c +7 -4
index fc0dbeb31d78..c730986ed34d 100644
@@ -1368,9 +1368,11 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
 
 	pcie->pex_ctl_supply = devm_regulator_get(dev, "vddio-pex-ctl");
 	if (IS_ERR(pcie->pex_ctl_supply)) {
-		dev_err(dev, "Failed to get regulator: %ld\n",
-			PTR_ERR(pcie->pex_ctl_supply));
-		return PTR_ERR(pcie->pex_ctl_supply);
+		ret = PTR_ERR(pcie->pex_ctl_supply);
+		if (ret != -EPROBE_DEFER)
+			dev_err(dev, "Failed to get regulator: %ld\n",
+				PTR_ERR(pcie->pex_ctl_supply));
+		return ret;
 	}
 
 	pcie->core_clk = devm_clk_get(dev, "core");
@@ -1412,7 +1414,8 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
 		kfree(name);
 		if (IS_ERR(phys[i])) {
 			ret = PTR_ERR(phys[i]);
-			dev_err(dev, "Failed to get PHY: %d\n", ret);
+			if (ret != -EPROBE_DEFER)
+				dev_err(dev, "Failed to get PHY: %d\n", ret);
 			return ret;
 		}
 	}
Signature · 1 line
2.17.1