Skip to content

Commit fa885b0

Browse files
raagjadavbjorn-helgaas
authored andcommitted
PCI/PM: Allow runtime PM with no PM callbacks at all
Commit c5eb119 ("PCI / PM: Allow runtime PM without callback functions") eliminated the need for PM callbacks in pci_pm_runtime_suspend() and pci_pm_runtime_resume(), but didn't do the same for pci_pm_runtime_idle(). Therefore, runtime suspend worked as long as the driver implemented at least one PM callback. But if the driver doesn't implement any PM callbacks at all (driver->pm is NULL), pci_pm_runtime_idle() returned -ENOSYS, which prevented runtime suspend. Modify pci_pm_runtime_idle() to allow PCI device power state transitions without runtime PM callbacks and complete the original intention of commit c5eb119 ("PCI / PM: Allow runtime PM without callback functions"). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Raag Jadav <[email protected]> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Jarkko Nikula <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Stanislaw Gruszka <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]>
1 parent cb98555 commit fa885b0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/pci/pci-driver.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,10 +1382,7 @@ static int pci_pm_runtime_idle(struct device *dev)
13821382
if (!pci_dev->driver)
13831383
return 0;
13841384

1385-
if (!pm)
1386-
return -ENOSYS;
1387-
1388-
if (pm->runtime_idle)
1385+
if (pm && pm->runtime_idle)
13891386
return pm->runtime_idle(dev);
13901387

13911388
return 0;

0 commit comments

Comments
 (0)