diff options
author | Lukas Wunner <lukas@wunner.de> | 2016-10-28 10:52:06 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-11-18 01:47:05 +0100 |
commit | 718a0609ae263b291848ecd0fa88bcf15ad49280 (patch) | |
tree | 66df3c488bf9bbfb35829f61470a88d4632e3509 /drivers/pci/pci.c | |
parent | PCI: Consolidate conditions to allow runtime PM on PCIe ports (diff) | |
download | linux-718a0609ae263b291848ecd0fa88bcf15ad49280.tar.xz linux-718a0609ae263b291848ecd0fa88bcf15ad49280.zip |
PCI: Unfold conditions to block runtime PM on PCIe ports
The conditions to block D3 on parent ports are currently condensed into a
single expression in pci_dev_check_d3cold(). Upcoming commits will add
further conditions for hotplug ports, making this expression fairly large
and impenetrable. Unfold the conditions to maintain readability when they
are amended.
No functional change intended.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Mika Westerberg <mika.westerberg@linux.intel.com>
CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index a40ba0225265..d86351a2fe6e 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2274,19 +2274,20 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge) static int pci_dev_check_d3cold(struct pci_dev *dev, void *data) { bool *d3cold_ok = data; - bool no_d3cold; - /* - * The device needs to be allowed to go D3cold and if it is wake - * capable to do so from D3cold. - */ - no_d3cold = dev->no_d3cold || !dev->d3cold_allowed || - (device_may_wakeup(&dev->dev) && !pci_pme_capable(dev, PCI_D3cold)) || - !pci_power_manageable(dev); + if (/* The device needs to be allowed to go D3cold ... */ + dev->no_d3cold || !dev->d3cold_allowed || + + /* ... and if it is wakeup capable to do so from D3cold. */ + (device_may_wakeup(&dev->dev) && + !pci_pme_capable(dev, PCI_D3cold)) || + + /* If it is a bridge it must be allowed to go to D3. */ + !pci_power_manageable(dev)) - *d3cold_ok = !no_d3cold; + *d3cold_ok = false; - return no_d3cold; + return !*d3cold_ok; } /* |