OSDN Git Service

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)
commit0c7376ada9508141becec9b897d73b65ce66a15a
tree147fa29efa806061702fcb07fee2f1ac911ec6a8
parent234f223d63d8f7db64a682ccf02871d40d38db52
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