ACPI/PCI: PM: Add missing wakeup.flags.valid checks
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 16 May 2019 10:42:20 +0000 (12:42 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 May 2019 08:51:06 +0000 (10:51 +0200)
commit9a51c6b1f9e0239a9435db036b212498a2a3b75c
tree26199d404c30f7f1f558570a31ed1e0543b41bcb
parentcd6c84d8f0cdc911df435bb075ba22ce3c605b07
ACPI/PCI: PM: Add missing wakeup.flags.valid checks

Both acpi_pci_need_resume() and acpi_dev_needs_resume() check if the
current ACPI wakeup configuration of the device matches what is
expected as far as system wakeup from sleep states is concerned, as
reflected by the device_may_wakeup() return value for the device.

However, they only should do that if wakeup.flags.valid is set for
the device's ACPI companion, because otherwise the wakeup.prepare_count
value for it is meaningless.

Add the missing wakeup.flags.valid checks to these functions.

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