diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-09-29 21:15:06 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-10-05 16:38:05 +0300 |
commit | fa1a25c51d02f153b49444aa872bee9da3c13ecf (patch) | |
tree | 18c98f4d1e7f541673066248022acbdb68d2b224 /drivers/pci | |
parent | 6407e5ecdc66cd9da760e751a7c092c87a683861 (diff) | |
download | linux-fa1a25c51d02f153b49444aa872bee9da3c13ecf.tar.xz |
PCI: PM: Do not call platform_pci_power_manageable() unnecessarily
Drop two invocations of platform_pci_power_manageable() that are not
necessary, because the functions called when it returns 'true' do the
requisite "power manageable" checks themselves.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Ferry Toth <fntoth@gmail.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index ae8fb60843dd..b0409bd33c45 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1191,9 +1191,7 @@ void pci_update_current_state(struct pci_dev *dev, pci_power_t state) */ void pci_refresh_power_state(struct pci_dev *dev) { - if (platform_pci_power_manageable(dev)) - platform_pci_refresh_power_state(dev); - + platform_pci_refresh_power_state(dev); pci_update_current_state(dev, dev->current_state); } @@ -1206,14 +1204,10 @@ int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state) { int error; - if (platform_pci_power_manageable(dev)) { - error = platform_pci_set_power_state(dev, state); - if (!error) - pci_update_current_state(dev, state); - } else - error = -ENODEV; - - if (error && !dev->pm_cap) /* Fall back to PCI_D0 */ + error = platform_pci_set_power_state(dev, state); + if (!error) + pci_update_current_state(dev, state); + else if (!dev->pm_cap) /* Fall back to PCI_D0 */ dev->current_state = PCI_D0; return error; |