Merge 4.14.76 into android-4.14-p
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / drivers / base / power / main.c
index e24f6500786e32f0c2a3d585c88975db2cdd85bf..594581a0c973b78f20e09f8795ce7ae36fafc40b 100644 (file)
@@ -1464,8 +1464,10 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
 
        dpm_wait_for_subordinate(dev, async);
 
-       if (async_error)
+       if (async_error) {
+               dev->power.direct_complete = false;
                goto Complete;
+       }
 
        /*
         * If a device configured to wake up the system from sleep states
@@ -1480,6 +1482,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
                pm_get_active_wakeup_sources(suspend_abort,
                        MAX_SUSPEND_ABORT_LEN);
                log_suspend_abort_reason(suspend_abort);
+               dev->power.direct_complete = false;
                async_error = -EBUSY;
                goto Complete;
        }