Skip to content

Commit 8851991

Browse files
dengrafLorenzo Pieralisi
authored andcommitted
PCI: tegra: Fix return value check of pm_runtime_get_sync()
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: da76ba5 ("PCI: tegra: Add power management support") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: David Engraf <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Andrew Murray <[email protected]> Cc: [email protected] # v4.17+
1 parent e42617b commit 8851991

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/controller/pci-tegra.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2798,7 +2798,7 @@ static int tegra_pcie_probe(struct platform_device *pdev)
27982798

27992799
pm_runtime_enable(pcie->dev);
28002800
err = pm_runtime_get_sync(pcie->dev);
2801-
if (err) {
2801+
if (err < 0) {
28022802
dev_err(dev, "fail to enable pcie controller: %d\n", err);
28032803
goto teardown_msi;
28042804
}

0 commit comments

Comments
 (0)