PM: core: Fix device_pm_check_callbacks()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 19 Sep 2017 00:22:39 +0000 (02:22 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 19 Sep 2017 20:58:27 +0000 (22:58 +0200)
commit157c460e10cb6eca29ccbd0f023db159d0c55ec7
tree06c2ceb8529ac64bf6e90ea315fe261ec989883e
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e
PM: core: Fix device_pm_check_callbacks()

The device_pm_check_callbacks() function doesn't check legacy
->suspend and ->resume callback pointers under the device's
bus type, class and driver, so in some cases it may set the
no_pm_callbacks flag for the device incorrectly and then the
callbacks may be skipped during system suspend/resume, which
shouldn't happen.

Fixes: aa8e54b55947 (PM / sleep: Go direct_complete if driver has no callbacks)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: 4.5+ <stable@vger.kernel.org> # 4.5+
drivers/base/power/main.c