]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: PM: Replace pci_dev_keep_suspended() with two functions
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 6 Jun 2019 22:32:31 +0000 (00:32 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 17 Jun 2019 10:30:24 +0000 (12:30 +0200)
commit3ba109cbc00842316804d967bc6df3685cdca634
tree147fa29efa806061702fcb07fee2f1ac911ec6a8
parent4d1347960c91d2957ced5fc5477b528351ba44ac
PCI: PM: Replace pci_dev_keep_suspended() with two functions

The code in pci_dev_keep_suspended() is relatively hard to follow due
to the negative checks in it and in its callers and the function has
a possible side-effect (disabling the PME) which doesn't really match
its role.

For this reason, move the PME disabling from pci_dev_keep_suspended()
to a separate function and change the semantics (and name) of the
rest of it, so that 'true' is returned when the device needs to be
resumed (and not the other way around).  Change the callers of
pci_dev_keep_suspended() accordingly.

While at it, make the code flow in pci_pm_poweroff() reflect the
pci_pm_suspend() more closely to avoid arbitrary differences between
them.

This is a cosmetic change with no intention to alter behavior.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/pci/pci-driver.c
drivers/pci/pci.c
drivers/pci/pci.h