linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: tegra: Correctly handle return code of pm_runtime_get_sync()
@ 2019-12-16  9:34 David Engraf
  2019-12-16 10:22 ` Andrew Murray
  0 siblings, 1 reply; 8+ messages in thread
From: David Engraf @ 2019-12-16  9:34 UTC (permalink / raw)
  To: thierry.reding, lorenzo.pieralisi, andrew.murray, bhelgaas, jonathanh
  Cc: linux-tegra, linux-pci, linux-kernel, David Engraf

pm_runtime_get_sync() returns the device's usage counter. This might
be >0 if the device is already powered up or CONFIG_PM is disabled.

Abort probe function on real error only.

Signed-off-by: David Engraf <david.engraf@sysgo.com>
---
 drivers/pci/controller/pci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
index 673a1725ef38..090b632965e2 100644
--- a/drivers/pci/controller/pci-tegra.c
+++ b/drivers/pci/controller/pci-tegra.c
@@ -2798,7 +2798,7 @@ static int tegra_pcie_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(pcie->dev);
 	err = pm_runtime_get_sync(pcie->dev);
-	if (err) {
+	if (err < 0) {
 		dev_err(dev, "fail to enable pcie controller: %d\n", err);
 		goto teardown_msi;
 	}
-- 
2.17.1


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

end of thread, other threads:[~2020-01-10 14:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16  9:34 [PATCH] PCI: tegra: Correctly handle return code of pm_runtime_get_sync() David Engraf
2019-12-16 10:22 ` Andrew Murray
2019-12-16 11:18   ` [PATCH v2] PCI: tegra: Fix return value check of pm_runtime_get_sync David Engraf
2019-12-16 11:20     ` Andrew Murray
2019-12-17 14:36     ` Bjorn Helgaas
2020-01-09 12:13       ` Lorenzo Pieralisi
2020-01-09 18:23         ` Bjorn Helgaas
2020-01-10 14:45           ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).