Linux-PCI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] PCI: tegra: Don't print an error on -EPROBE_DEFER
@ 2019-08-23 15:18 Vidya Sagar
  2019-08-23 15:41 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Vidya Sagar @ 2019-08-23 15:18 UTC (permalink / raw)
  To: lorenzo.pieralisi, bhelgaas, thierry.reding, jonathanh
  Cc: linux-tegra, linux-pci, linux-kernel, kthota, mmaddireddy,
	vidyas, sagar.tv

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.

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

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index fc0dbeb31d78..c730986ed34d 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -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;
 		}
 	}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: tegra: Don't print an error on -EPROBE_DEFER
  2019-08-23 15:18 [PATCH] PCI: tegra: Don't print an error on -EPROBE_DEFER Vidya Sagar
@ 2019-08-23 15:41 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2019-08-23 15:41 UTC (permalink / raw)
  To: Vidya Sagar
  Cc: bhelgaas, thierry.reding, jonathanh, linux-tegra, linux-pci,
	linux-kernel, kthota, mmaddireddy, sagar.tv

On Fri, Aug 23, 2019 at 08:48:32PM +0530, Vidya Sagar wrote:
> 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.
> 
> Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
> ---
>  drivers/pci/controller/dwc/pcie-tegra194.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)

Squashed in pci/tegra, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index fc0dbeb31d78..c730986ed34d 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -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;
>  		}
>  	}
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23 15:18 [PATCH] PCI: tegra: Don't print an error on -EPROBE_DEFER Vidya Sagar
2019-08-23 15:41 ` Lorenzo Pieralisi

Linux-PCI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pci/0 linux-pci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pci linux-pci/ https://lore.kernel.org/linux-pci \
		linux-pci@vger.kernel.org linux-pci@archiver.kernel.org
	public-inbox-index linux-pci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox