diff mbox

[v2,1/3] PM / sleep: Check legacy pm callbacks for direct complete

Message ID 1456359748-22838-1-git-send-email-dbasehore@chromium.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Derek Basehore Feb. 25, 2016, 12:22 a.m. UTC
This adds checks for legacy pm callbacks when setting no_pm_callbacks.
This fixes an issue where these suspend/resume callbacks were
incorrectly ignored during suspend/resume with direct complete.

Fixes: aa8e54b55947 "PM / sleep: Go direct_complete if driver has..."
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
---
 drivers/base/power/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 6e7c3cc..e0017d9 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1764,8 +1764,10 @@  void device_pm_check_callbacks(struct device *dev)
 {
 	spin_lock_irq(&dev->power.lock);
 	dev->power.no_pm_callbacks =
-		(!dev->bus || pm_ops_is_empty(dev->bus->pm)) &&
-		(!dev->class || pm_ops_is_empty(dev->class->pm)) &&
+		(!dev->bus || (!dev->bus->resume && !dev->bus->suspend &&
+			       pm_ops_is_empty(dev->bus->pm))) &&
+		(!dev->class || (!dev->class->resume && !dev->class->suspend &&
+				 pm_ops_is_empty(dev->class->pm))) &&
 		(!dev->type || pm_ops_is_empty(dev->type->pm)) &&
 		(!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) &&
 		(!dev->driver || pm_ops_is_empty(dev->driver->pm));