public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Engraf <david.engraf@sysgo.com>
To: thierry.reding@gmail.com, lorenzo.pieralisi@arm.com,
	andrew.murray@arm.com, bhelgaas@google.com, jonathanh@nvidia.com
Cc: linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	David Engraf <david.engraf@sysgo.com>
Subject: [PATCH v2] PCI: tegra: Fix return value check of pm_runtime_get_sync
Date: Mon, 16 Dec 2019 12:18:25 +0100	[thread overview]
Message-ID: <20191216111825.28136-1-david.engraf@sysgo.com> (raw)
In-Reply-To: <20191216102208.GO24359@e119886-lin.cambridge.arm.com>

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.

Fixes: da76ba50963b ("PCI: tegra: Add power management support")
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


  reply	other threads:[~2019-12-16 11:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` David Engraf [this message]
2019-12-16 11:20     ` [PATCH v2] PCI: tegra: Fix return value check of pm_runtime_get_sync 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191216111825.28136-1-david.engraf@sysgo.com \
    --to=david.engraf@sysgo.com \
    --cc=andrew.murray@arm.com \
    --cc=bhelgaas@google.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox