runtime-pm: remove a superfluous k_is_pre_kernel() test

If runtime_suspend() is called early during Zephyr initialisation,
while k_is_pre_kernel() returns 'true,' 'async' is set to 'false,' so
if 'async' is 'true,' Zephyr initialisation is definitely complete,
so there is no need to check k_is_pre_kernel() again.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2024-01-15 15:48:24 +01:00 committed by Carles Cufí
commit a1fd8cd078

View file

@ -76,7 +76,7 @@ static int runtime_suspend(const struct device *dev, bool async,
goto unlock; goto unlock;
} }
if (async && !k_is_pre_kernel()) { if (async) {
/* queue suspend */ /* queue suspend */
pm->state = PM_DEVICE_STATE_SUSPENDING; pm->state = PM_DEVICE_STATE_SUSPENDING;
(void)k_work_schedule(&pm->work, delay); (void)k_work_schedule(&pm->work, delay);