@@ -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));
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: 4534d9d881f9 "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(-)