]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
PCI/PM: Simplify pci_set_power_state()
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 16 Oct 2019 20:23:20 +0000 (15:23 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 20 Nov 2019 23:34:47 +0000 (17:34 -0600)
commitbaef7f8e5e91f85ce7625c11370479f9f0778fae
tree7e89c8694274a6530b2ebafff73780129883cdca
parent993cc6d1bd3af734693a74a3ccc9445dd5b31f9c
PCI/PM: Simplify pci_set_power_state()

Check for the PCI_DEV_FLAGS_NO_D3 quirk early, before calling
__pci_start_power_transition().  This way all the cases where we don't need
to do anything at all are checked up front.

This doesn't fix anything because if the caller requested D3hot or D3cold,
__pci_start_power_transition() is a no-op.  But calling it is pointless and
makes the code harder to analyze.

Link: https://lore.kernel.org/r/20191101204558.210235-4-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pci/pci.c